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] actor docstrings #2626

Merged
merged 1 commit into from
Dec 3, 2024
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
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
Loading