Note
Ray 2.40 uses RLlib’s new API stack by default. The Ray team has mostly completed transitioning algorithms, example scripts, and documentation to the new code base.
If you’re still using the old API stack, see New API stack migration guide for details on how to migrate.
LearnerGroup API#
Configuring a LearnerGroup and Learner actors#
Sets LearnerGroup and Learner worker related configurations. |
Constructing a LearnerGroup#
Builds and returns a new LearnerGroup object based on settings in |
Coordinator of n (possibly remote) Learner workers. |
Learner API#
Constructing a Learner#
Builds and returns a new Learner object based on settings in |
Base class for Learners. |
|
Builds the Learner. |
|
Construct the multi-agent RL module for the learner. |
Implementing a custom RLModule to fit a Learner#
Returns the required APIs for an RLModule to be compatible with this Learner. |
|
Check whether the given |
Performing updates#
Run |
|
Run |
|
Called before gradient-based updates are completed. |
|
Called after gradient-based updates are completed. |
Computing losses#
Computes the loss(es) for the module being optimized. |
|
Computes the loss for a single module. |
Configuring optimizers#
Configures an optimizer for the given module_id. |
|
Configures, creates, and registers the optimizers for this Learner. |
|
Registers an optimizer with a ModuleID, name, param list and lr-scheduler. |
|
Returns a list of (optimizer_name, optimizer instance)-tuples for module_id. |
|
Returns the optimizer object, configured under the given module_id and name. |
|
Returns the list of parameters of a module. |
|
Returns a hashable reference to a trainable parameter. |
|
Reduces the given ParamDict to contain only parameters for given optimizer. |
|
Checks that the given optimizer and parameters are valid for the framework. |
|
Updates the learning rate of the given local optimizer. |
Gradient computation#
Computes the gradients based on the given losses. |
|
Applies potential postprocessing operations on the gradients. |
|
Applies postprocessing operations on the gradients of the given module. |
|
Applies the gradients to the MultiRLModule parameters. |
|
Returns the gradient clipping function to use, given the framework. |
Saving, loading, checkpointing, and restoring states#
Saves the state of the implementing class (or |
|
Restores the state of the implementing class from the given path. |
|
Creates a new Checkpointable instance from the given location and returns it. |
|
Returns the implementing class's current state as a dict. |
|
Sets the implementing class' state to the given state dict. |
Adding and removing modules#
Adds a module to the underlying MultiRLModule. |
|
Removes a module from the Learner. |