Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc, Test] Add A2C script test and doc #702

Merged
merged 2 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .circleci/unittest/linux_examples/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ coverage run examples/ddpg/ddpg.py \
record_video=True \
record_frames=4 \
buffer_size=120
coverage run examples/a2c/a2c.py \
total_frames=48 \
init_random_frames=10 \
batch_size=10 \
frames_per_batch=16 \
num_workers=2 \
env_per_collector=1 \
collector_devices=cuda:0 \
optim_steps_per_batch=1 \
record_video=True \
record_frames=4 \
buffer_size=120
coverage run examples/dqn/dqn.py \
total_frames=48 \
init_random_frames=10 \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,11 @@ If you would like to contribute to new features, check our [call for contributio
A series of [examples](examples/) are provided with an illustrative purpose:
- [DQN (and add-ons up to Rainbow)](examples/dqn/dqn.py)
- [DDPG](examples/ddpg/ddpg.py)
- [A2C](examples/a2c/a2c.py)
- [PPO](examples/ppo/ppo.py)
- [SAC](examples/sac/sac.py)
- [REDQ](examples/redq/redq.py)
- [Dreamer](examples/dreamer/dreamer.py)

and many more to come!

Expand Down
10 changes: 10 additions & 0 deletions docs/source/reference/objectives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ PPO
ClipPPOLoss
KLPENPPOLoss

A2C
---

.. autosummary::
:toctree: generated/
:template: rl_template_noinherit.rst

A2CLoss


Returns
-------
.. currentmodule:: torchrl.objectives.value
Expand Down
2 changes: 2 additions & 0 deletions docs/source/reference/trainers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ Builders
transformed_env_constructor
parallel_env_constructor
make_sac_loss
make_a2c_loss
make_dqn_loss
make_ddpg_loss
make_target_updater
Expand All @@ -172,6 +173,7 @@ Builders
make_dqn_actor
make_ddpg_actor
make_ppo_model
make_a2c_model
make_sac_model
make_redq_model
make_replay_buffer
Expand Down