Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Valter Schutz committed Dec 3, 2024
1 parent b2e9f29 commit 97196a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions torchrl/modules/tensordict_module/actors.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ class ProbabilisticActor(SafeProbabilisticTensorDictSequential):
issues. If this value is out of bounds, it is projected back onto the
desired space using the :obj:`TensorSpec.project`
method. Default is ``False``.
default_interaction_type (str, optional): keyword-only argument.
default_interaction_type (tensordict.nn.InteractionType, optional): keyword-only argument.
Default method to be used to retrieve
the output value. Should be one of: 'InteractionType.MODE', 'InteractionType.DETERMINISTIC',
'InteractionType.MEDIAN', 'InteractionType.MEAN' or
'InteractionType.RANDOM' (in which case the value is sampled
the output value. Should be one of: ``InteractionType.MODE``, ``InteractionType.DETERMINISTIC``,
``InteractionType.MEDIAN``, ``InteractionType.MEAN`` or
``InteractionType.RANDOM`` (in which case the value is sampled
randomly from the distribution).
TorchRL's ``ExplorationType`` class is a proxy to ``InteractionType``.
Defaults to is 'InteractionType.DETERMINISTIC'.
Defaults to ``InteractionType.DETERMINISTIC``.
.. note:: When a sample is drawn, the :class:`ProbabilisticActor` instance will
first look for the interaction mode dictated by the
Expand Down
8 changes: 4 additions & 4 deletions torchrl/modules/tensordict_module/probabilistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ class SafeProbabilisticModule(ProbabilisticTensorDictModule):
returned by the input module. If the sample is out of bounds, it is
projected back onto the desired space using the `TensorSpec.project` method.
Default is ``False``.
default_interaction_type (str, optional): default method to be used to retrieve
the output value. Should be one of: 'mode', 'median', 'mean' or 'random'
default_interaction_type (tensordict.nn.InteractionType, optional): default method to be used to retrieve
the output value. Should be one of: ``InteractionType.MODE``, ``InteractionType.MEDIAN``, ``InteractionType.MEAN`` or ``InteractionType.RANDOM``
(in which case the value is sampled randomly from the distribution). Default
is 'mode'.
is ``InteractionType.MODE``.
Note: When a sample is drawn, the :obj:`ProbabilisticTDModule` instance will
fist look for the interaction mode dictated by the `interaction_typ()`
fist look for the interaction mode dictated by the `interaction_type()`
global function. If this returns `None` (its default value), then the
`default_interaction_type` of the :class:`~.ProbabilisticTDModule`
instance will be used. Note that DataCollector instances will use
Expand Down

0 comments on commit 97196a0

Please sign in to comment.