Skip to content

Commit

Permalink
[RLlib][docs] Learner API Docs (#37729) (#38137)
Browse files Browse the repository at this point in the history
Signed-off-by: Avnish <[email protected]>
  • Loading branch information
avnishn authored Aug 7, 2023
1 parent f79203d commit 9a2ecc3
Show file tree
Hide file tree
Showing 9 changed files with 666 additions and 30 deletions.
1 change: 1 addition & 0 deletions doc/source/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ parts:
- file: rllib/rllib-catalogs
- file: rllib/rllib-connector
- file: rllib/rllib-rlmodule
- file: rllib/rllib-learner
- file: rllib/rllib-torch2x
- file: rllib/rllib-fault-tolerance
- file: rllib/rllib-dev
Expand Down
1 change: 1 addition & 0 deletions doc/source/rllib/package_ref/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ If you think there is anything missing, please open an issue on `Github`_.
models.rst
catalogs.rst
rl_modules.rst
learner.rst
evaluation.rst
replay-buffers.rst
utils.rst
Expand Down
156 changes: 156 additions & 0 deletions doc/source/rllib/package_ref/learner.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
.. _learner-reference-docs:

Learner API
===========

Learner specifications and configurations
-----------------------------------------

.. currentmodule:: ray.rllib.core.learner.learner

.. autosummary::
:toctree: doc/

FrameworkHyperparameters
LearnerHyperparameters

TorchLearner configurations
+++++++++++++++++++++++++++

.. autosummary::
:toctree: doc/

TorchCompileWhatToCompile

Constructor
-----------

.. autosummary::
:toctree: doc/

Learner
Learner.build
Learner._check_is_built
Learner._make_module

Performing Updates
------------------

.. autosummary::
:toctree: doc/

Learner.update
Learner._update
Learner.additional_update
Learner.additional_update_for_module
Learner._convert_batch_type


Computing Losses
----------------

.. autosummary::
:toctree: doc/

Learner.compute_loss
Learner.compute_loss_for_module
Learner._is_module_compatible_with_learner
Learner._get_tensor_variable


Configuring Optimizers
----------------------

.. autosummary::
:toctree: doc/

Learner.configure_optimizers_for_module
Learner.configure_optimizers
Learner.register_optimizer
Learner.get_optimizers_for_module
Learner.get_optimizer
Learner.get_parameters
Learner.get_param_ref
Learner.filter_param_dict_for_optimizer
Learner._check_registered_optimizer
Learner._set_optimizer_lr
Learner._get_clip_function


Gradient Computation
--------------------

.. autosummary::
:toctree: doc/

Learner.compute_gradients
Learner.postprocess_gradients
Learner.postprocess_gradients_for_module
Learner.apply_gradients

Saving, Loading, Checkpointing, and Restoring States
----------------------------------------------------

.. autosummary::
:toctree: doc/

Learner.save_state
Learner.load_state
Learner._save_optimizers
Learner._load_optimizers
Learner.get_state
Learner.set_state
Learner.get_optimizer_state
Learner.set_optimizer_state
Learner._get_metadata

Adding and Removing Modules
---------------------------

.. autosummary::
:toctree: doc/

Learner.add_module
Learner.remove_module

Managing Results
----------------

.. autosummary::
:toctree: doc/

Learner.compile_results
Learner.register_metric
Learner.register_metrics
Learner._check_result



LearnerGroup API
================

Configuring a LearnerGroup
--------------------------

.. autosummary::
:toctree: doc/

LearnerSpec

.. currentmodule:: ray.rllib.core.learner.learner_group

.. autosummary::
:toctree: doc/

LearnerGroup











2 changes: 1 addition & 1 deletion doc/source/rllib/package_ref/rl_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RLModule API
============


RL Module specifications and configuraitons
RL Module specifications and configurations
-------------------------------------------

Single Agent
Expand Down
Loading

0 comments on commit 9a2ecc3

Please sign in to comment.