Skip to content

Commit

Permalink
[Doc] A bit more doc on modules (#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens authored Apr 13, 2023
1 parent 8d8d108 commit 40004e6
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions docs/source/reference/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ feed a tensor-to-tensor map that given a certain state (the input tensor),
outputs a list of action values to choose from. The wrapper will write the
resulting action in the input tensordict along with the list of action values.

.. code-block::Python
>>> import torch
>>> from tensordict import TensorDict
>>> from tensordict.nn.functional_modules import make_functional
Expand Down Expand Up @@ -186,8 +184,6 @@ the value network encodes a :math:`\mathbb{R}^{M} \rightarrow \mathbb{R}^{N \tim
map. The following example shows how this works in TorchRL with the :class:`~torchrl.modules.tensordict_module.DistributionalQValueActor`
class:

.. code-block::Python
>>> import torch
>>> from tensordict import TensorDict
>>> from torch import nn
Expand Down Expand Up @@ -294,19 +290,36 @@ Models
------
.. currentmodule:: torchrl.modules

TorchRL provides a series of useful "regular" (ie non-tensordict) nn.Module
classes for RL usage.

Regular modules
~~~~~~~~~~~~~~~

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

MLP
ConvNet
LSTMNet

Algorithm-specific modules
~~~~~~~~~~~~~~~~~~~~~~~~~~

These networks implement sub-networks that have shown to be useful for specific
algorithms, such as DQN, DDPG or Dreamer.

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

DuelingCnnDQNet
DistributionalDQNnet
DdpgCnnActor
DdpgCnnQNet
DdpgMlpActor
DdpgMlpQNet
LSTMNet
DreamerActor
ObsEncoder
ObsDecoder
Expand All @@ -318,6 +331,10 @@ Exploration
-----------
.. currentmodule:: torchrl.modules

Noisy linear layers are a popular way of exploring the environment without
altering the actions, but by integrating the stochasticity in the weight
configuration.

.. autosummary::
:toctree: generated/
:template: rl_template_noinherit.rst
Expand All @@ -342,6 +359,10 @@ Planners

Distributions
-------------
.. currentmodule:: torchrl.modules

Some distributions are typically used in RL scripts.

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

0 comments on commit 40004e6

Please sign in to comment.