Skip to content

Commit

Permalink
[RLlib][Docs] Restructure Modelv2's API page (#33356)
Browse files Browse the repository at this point in the history
Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com>
  • Loading branch information
kouroshHakha authored Mar 21, 2023
1 parent eeda97c commit e5ca789
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions doc/source/rllib/package_ref/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,49 @@
Model APIs
==========

ModelV2 API (rllib.env.models.modelv2.ModelV2)
++++++++++++++++++++++++++++++++++++++++++++++
.. currentmodule:: ray.rllib.models

All RLlib neural network models have to be provided as ModelV2 sub-classes.
Base Model classes
-------------------

.. autoclass:: ray.rllib.models.modelv2.ModelV2
:members:
.. autosummary::
:toctree: doc/
:template: autosummary/class_with_autosummary.rst

~modelv2.ModelV2
~torch.torch_modelv2.TorchModelV2
~tf.tf_modelv2.TFModelV2

RLlib comes with two sub-classes for TF (keras) models and PyTorch models:
Feed Forward methods
---------------------
.. autosummary::
:toctree: doc/

TFModelV2 (rllib.env.models.tf.tf_modelv2.TFModelV2)
++++++++++++++++++++++++++++++++++++++++++++++++++++
~modelv2.ModelV2.forward
~modelv2.ModelV2.value_function
~modelv2.ModelV2.last_output

.. autoclass:: ray.rllib.models.tf.tf_modelv2.TFModelV2
:members:
Recurrent Models API
---------------------
.. autosummary::
:toctree: doc/

TorchModelV2 (rllib.env.models.torch.torch_modelv2.TorchModelV2)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
~modelv2.ModelV2.get_initial_state
~modelv2.ModelV2.is_time_major

.. autoclass:: ray.rllib.models.torch.torch_modelv2.TorchModelV2
:members:
Acessing variables
---------------------
.. autosummary::
:toctree: doc/

~modelv2.ModelV2.variables
~modelv2.ModelV2.trainable_variables

Customization
--------------
.. autosummary::
:toctree: doc/

~modelv2.ModelV2.custom_loss
~modelv2.ModelV2.metrics

0 comments on commit e5ca789

Please sign in to comment.