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

[RLlib][Docs] Restructure Modelv2's API page #33356

Merged
merged 2 commits into from
Mar 21, 2023
Merged
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
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