forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RLlib][Docs] Restructure Policy's API page (ray-project#33344)
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
- Loading branch information
1 parent
ef43388
commit 0047d01
Showing
6 changed files
with
332 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
.. _custom-policies-reference-docs: | ||
|
||
Building Custom Policy Classes | ||
============================== | ||
------------------------------ | ||
|
||
.. currentmodule:: ray.rllib | ||
|
||
.. warning:: | ||
As of Ray >= 1.9, it is no longer recommended to use the ``build_policy_class()`` or | ||
``build_tf_policy()`` utility functions for creating custom Policy sub-classes. | ||
Instead, follow the simple guidelines here for directly sub-classing from | ||
either one of the built-in types: | ||
:py:class:`~ray.rllib.policy.dynamic_tf_policy.DynamicTFPolicy` | ||
:py:class:`~policy.eager_tf_policy_v2.EagerTFPolicyV2` | ||
or | ||
:py:class:`~ray.rllib.policy.torch_policy.TorchPolicy` | ||
:py:class:`~policy.torch_policy_v2.TorchPolicyV2` | ||
|
||
In order to create a custom Policy, sub-class :py:class:`~ray.rllib.policy.policy.Policy` (for a generic, | ||
In order to create a custom Policy, sub-class :py:class:`~policy.policy.Policy` (for a generic, | ||
framework-agnostic policy), | ||
:py:class:`~ray.rllib.policy.torch_policy.TorchPolicy` | ||
:py:class:`~policy.torch_policy_v2.TorchPolicyV2` | ||
(for a PyTorch specific policy), or | ||
:py:class:`~ray.rllib.policy.dynamic_tf_policy.DynamicTFPolicy` | ||
:py:class:`~policy.eager_tf_policy_v2.EagerTFPolicyV2` | ||
(for a TensorFlow specific policy) and override one or more of their methods. Those are in particular: | ||
|
||
* :py:meth:`~ray.rllib.policy.policy.Policy.compute_actions_from_input_dict` | ||
* :py:meth:`~ray.rllib.policy.policy.Policy.postprocess_trajectory` | ||
* :py:meth:`~ray.rllib.policy.policy.Policy.loss` | ||
* :py:meth:`~policy.policy.Policy.compute_actions_from_input_dict` | ||
* :py:meth:`~policy.policy.Policy.postprocess_trajectory` | ||
* :py:meth:`~policy.policy.Policy.loss` | ||
|
||
`See here for an example on how to override TorchPolicy <https://github.com/ray-project/ray/blob/master/rllib/algorithms/ppo/ppo_torch_policy.py>`_. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.