ray.rllib.core.learner.learner_group.LearnerGroup
ray.rllib.core.learner.learner_group.LearnerGroup#
- class ray.rllib.core.learner.learner_group.LearnerGroup(learner_spec: ray.rllib.core.learner.learner.LearnerSpec, max_queue_len: int = 20)[source]#
Bases:
objectCoordinator of Learners.
- Parameters
learner_spec – The specification for constructing Learners.
max_queue_len – The maximum number of batches to queue up if doing async_update If the queue is full itwill evict the oldest batch first.
Methods
add_module(*, module_id, module_spec)Add a module to the Learners maintained by this LearnerGroup.
additional_update(*[, reduce_fn])Apply additional non-gradient based updates to the Learners.
async_update(batch, *[, minibatch_size, ...])Asnychronously do gradient based updates to the Learner(s) with
batch.Returns the current stats for the input queue for this learner group.
Get the states of the first Learners.
get_weights([module_ids])Get the weights of the MultiAgentRLModule maintained by each Learner.
load_module_state(*[, marl_module_ckpt_dir, ...])Load the checkpoints of the modules being trained by this LearnerGroup.
load_state(path)Loads the state of the LearnerGroup.
remove_module(module_id)Remove a module from the Learners maintained by this LearnerGroup.
save_state(path)Saves the state of the LearnerGroup.
set_is_module_trainable([is_module_trainable])Sets the function that determines whether a module is trainable.
set_state(state)Sets the states of the Learners.
set_weights(weights)Set the weights of the MultiAgentRLModule maintained by each Learner.
shutdown()Shuts down the LearnerGroup.
update(batch, *[, minibatch_size, ...])Do one or more gradient based updates to the Learner(s) based on given data.
Attributes