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] Document losses in README.md #2408

Merged
merged 14 commits into from
Sep 17, 2024
Merged
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
286 changes: 273 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,19 +523,279 @@ If you would like to contribute to new features, check our [call for contributio
## Examples, tutorials and demos

A series of [examples](https://github.com/pytorch/rl/blob/main/examples/) are provided with an illustrative purpose:
- [DQN](https://github.com/pytorch/rl/blob/main/sota-implementations/dqn)
- [DDPG](https://github.com/pytorch/rl/blob/main/sota-implementations/ddpg/ddpg.py)
- [IQL](https://github.com/pytorch/rl/blob/main/sota-implementations/iql/iql_offline.py)
- [CQL](https://github.com/pytorch/rl/blob/main/sota-implementations/cql/cql_offline.py)
- [TD3](https://github.com/pytorch/rl/blob/main/sota-implementations/td3/td3.py)
- [TD3+BC](https://github.com/pytorch/rl/blob/main/sota-implementations/td3+bc/td3+bc.py)
- [A2C](https://github.com/pytorch/rl/blob/main/examples/a2c_old/a2c.py)
- [PPO](https://github.com/pytorch/rl/blob/main/sota-implementations/ppo/ppo.py)
- [SAC](https://github.com/pytorch/rl/blob/main/sota-implementations/sac/sac.py)
- [REDQ](https://github.com/pytorch/rl/blob/main/sota-implementations/redq/redq.py)
- [Dreamer](https://github.com/pytorch/rl/blob/main/sota-implementations/dreamer/dreamer.py)
- [Decision Transformers](https://github.com/pytorch/rl/blob/main/sota-implementations/decision_transformer)
- [RLHF](https://github.com/pytorch/rl/blob/main/examples/rlhf)

<table>
<tr>
<td><strong>Algorithm</strong>
</td>
<td><strong>Compile Support**</strong>
</td>
<td><strong>Tensordict-free API</strong>
</td>
<td><strong>Modular Losses</strong>
</td>
<td><strong>Continuous and Discrete</strong>
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/dqn">DQN</a>
</td>
<td> 1.9x
</td>
<td> +
</td>
<td> NA
</td>
<td> + (through <a href="https://pytorch.org/rl/stable/reference/generated/torchrl.envs.transforms.ActionDiscretizer.html?highlight=actiondiscretizer">ActionDiscretizer</a> transform)
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/ddpg/ddpg.py">DDPG</a>
</td>
<td> 1.87x
</td>
<td> +
</td>
<td> +
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/iql/">IQL</a>
</td>
<td> 3.22x
</td>
<td> +
</td>
<td> +
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/cql/cql_offline.py">CQL</a>
</td>
<td> 2.68x
</td>
<td> +
</td>
<td> +
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/td3/td3.py">TD3</a>
</td>
<td> 2.27x
</td>
<td> +
</td>
<td> +
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td>
<a href="https://github.com/pytorch/rl/blob/main/sota-implementations/td3_bc/td3_bc.py">TD3+BC</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> +
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td>
<a href="https://github.com/pytorch/rl/blob/main/examples/a2c/">A2C</a>
</td>
<td> 2.67x
</td>
<td> +
</td>
<td> -
</td>
<td> +
</td>
</tr>
<tr>
<td>
<a href="https://github.com/pytorch/rl/blob/main/sota-implementations/ppo/">PPO</a>
</td>
<td> 2.42x
</td>
<td> +
</td>
<td> -
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/sac/sac.py">SAC</a>
</td>
<td> 2.62x
</td>
<td> +
</td>
<td> -
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/redq/redq.py">REDQ</a>
</td>
<td> 2.28x
</td>
<td> +
</td>
<td> -
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/dreamer/dreamer.py">Dreamer v1</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> + (<a href="https://pytorch.org/rl/stable/reference/objectives.html#dreamer">different classes</a>)
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/decision_transformer">Decision Transformers</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> NA
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/crossq">CrossQ</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> +
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/gail">Gail</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> NA
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/impala">Impala</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> -
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/multiagent/iql.py">IQL (MARL)</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> +
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/multiagent/maddpg_iddpg.py">DDPG (MARL)</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> +
</td>
<td> - (continuous only)
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/multiagent/mappo_ippo.py">PPO (MARL)</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> -
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/multiagent/qmix_vdn.py">QMIX-VDN (MARL)</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> NA
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/sota-implementations/multiagent/sac.py">SAC (MARL)</a>
</td>
<td> untested
</td>
<td> +
</td>
<td> -
</td>
<td> +
</td>
</tr>
<tr>
<td><a href="https://github.com/pytorch/rl/blob/main/examples/rlhf">RLHF</a>
</td>
<td> NA
</td>
<td> +
</td>
<td> NA
</td>
<td> NA
</td>
</tr>
</table>

** The number indicates expected speed-up compared to eager mode when executed on CPU. Numbers may vary depending on
architecture and device.

and many more to come!

Expand Down
Loading