Skip to content

Commit 96331c4

Browse files
authored
[Doc, Test] Add A2C script test and doc (#702)
1 parent 9a81a97 commit 96331c4

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

.circleci/unittest/linux_examples/scripts/run_test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ coverage run examples/ddpg/ddpg.py \
3838
record_video=True \
3939
record_frames=4 \
4040
buffer_size=120
41+
coverage run examples/a2c/a2c.py \
42+
total_frames=48 \
43+
init_random_frames=10 \
44+
batch_size=10 \
45+
frames_per_batch=16 \
46+
num_workers=2 \
47+
env_per_collector=1 \
48+
collector_devices=cuda:0 \
49+
optim_steps_per_batch=1 \
50+
record_video=True \
51+
record_frames=4 \
52+
buffer_size=120
4153
coverage run examples/dqn/dqn.py \
4254
total_frames=48 \
4355
init_random_frames=10 \

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,11 @@ If you would like to contribute to new features, check our [call for contributio
350350
A series of [examples](examples/) are provided with an illustrative purpose:
351351
- [DQN (and add-ons up to Rainbow)](examples/dqn/dqn.py)
352352
- [DDPG](examples/ddpg/ddpg.py)
353+
- [A2C](examples/a2c/a2c.py)
353354
- [PPO](examples/ppo/ppo.py)
354355
- [SAC](examples/sac/sac.py)
355356
- [REDQ](examples/redq/redq.py)
357+
- [Dreamer](examples/dreamer/dreamer.py)
356358

357359
and many more to come!
358360

docs/source/reference/objectives.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ PPO
5151
ClipPPOLoss
5252
KLPENPPOLoss
5353

54+
A2C
55+
---
56+
57+
.. autosummary::
58+
:toctree: generated/
59+
:template: rl_template_noinherit.rst
60+
61+
A2CLoss
62+
63+
5464
Returns
5565
-------
5666
.. currentmodule:: torchrl.objectives.value

docs/source/reference/trainers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ Builders
164164
transformed_env_constructor
165165
parallel_env_constructor
166166
make_sac_loss
167+
make_a2c_loss
167168
make_dqn_loss
168169
make_ddpg_loss
169170
make_target_updater
@@ -172,6 +173,7 @@ Builders
172173
make_dqn_actor
173174
make_ddpg_actor
174175
make_ppo_model
176+
make_a2c_model
175177
make_sac_model
176178
make_redq_model
177179
make_replay_buffer

0 commit comments

Comments
 (0)