ray.rllib.core.learner.learner_group.LearnerGroup#
- class ray.rllib.core.learner.learner_group.LearnerGroup(*, config: AlgorithmConfig, module_spec: RLModuleSpec | MultiRLModuleSpec | None = None)[source]#
- Bases: - Checkpointable- Coordinator of n (possibly remote) Learner workers. - Each Learner worker has a copy of the RLModule, the loss function(s), and one or more optimizers. - PublicAPI (alpha): This API is in alpha and may change before becoming stable. - Methods - Initializes a LearnerGroup instance. - Adds a module to the underlying MultiRLModule. - Calls the given function on each Learner L with the args: (L, **kwargs). - Creates a new Checkpointable instance from the given location and returns it. - Returns JSON writable metadata further describing the implementing class. - Returns the current stats for the input queue for this learner group. - Convenience method instead of self.get_state(components=...). - Removes a module from the Learner. - Restores the state of the implementing class from the given path. - Saves the state of the implementing class (or - state) to- path.- Convenience method instead of self.set_state({'learner': {'rl_module': ..}}). - Shuts down the LearnerGroup. - Performs gradient based update(s) on the Learner(s), based on given batch. - Performs gradient based update(s) on the Learner(s), based on given episodes. - Attributes