Note
Ray 2.10.0 introduces the alpha stage of RLlib’s “new API stack”. The team is currently transitioning algorithms, example scripts, and documentation to the new code base throughout the subsequent minor releases leading up to Ray 3.0.
See here for more details on how to activate and use the new API stack.
RLModule API#
RL Module specifications and configurations#
Single Agent#
Utility spec class to make constructing RLModules (in single-agent case) easier. |
|
Builds the RLModule from this spec. |
|
RLModule Configuration#
Multi RLModule (multi-agent)#
A utility spec class to make it constructing MultiRLModules easier. |
|
Builds either the MultiRLModule or a (single) sub-RLModule under |
|
RL Module API#
Constructor#
Base class for RLlib modules. |
|
Returns a multi-agent wrapper around this module. |
Forward methods#
DO NOT OVERRIDE! Forward-pass during training called from the learner. |
|
DO NOT OVERRIDE! Forward-pass during exploration, called from the sampler. |
|
DO NOT OVERRIDE! Forward-pass during evaluation, called from the sampler. |
|
Forward-pass used before the loss computation (training). |
|
Forward-pass used for action computation with exploration behavior. |
|
Forward-pass used for action computation without exploration behavior. |
IO specifications#
Returns the input specs of the forward_inference method. |
|
Returns the input specs of the forward_exploration method. |
|
Returns the input specs of the forward_train method. |
|
Returns the output specs of the forward_train method. |
Saving and Loading#
Returns the state dict of the module. |
|
Sets the implementing class' state to the given state dict. |
|
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. |
Multi Agent RL Module API#
Constructor#
Base class for an RLModule that contains n sub-RLModules. |
|
Sets up the underlying, individual RLModules. |
|
Returns self in order to match |
Modifying the underlying RL modules#
Adds a module at run time to the multi-agent module. |
|
Removes a module at runtime from the multi-agent module. |
Saving and Loading#
Saves the state of the implementing class (or |
|
Restores the state of the implementing class from the given path. |