ray.rllib.core.learner.learner_group.LearnerGroup#

class ray.rllib.core.learner.learner_group.LearnerGroup(learner_spec: LearnerSpec, max_queue_len: int = 20)[source]#

Coordinator 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.

PublicAPI (alpha): This API is in alpha and may change before becoming stable.

Methods

add_module

Add a module to the Learners maintained by this LearnerGroup.

additional_update

Apply additional non-gradient based updates to the Learners.

async_update

Asnychronously do gradient based updates to the Learner(s) with batch.

get_in_queue_stats

Returns the current stats for the input queue for this learner group.

get_state

Get the states of the first Learners.

get_weights

Get the weights of the MultiAgentRLModule maintained by each Learner.

load_module_state

Load the checkpoints of the modules being trained by this LearnerGroup.

load_state

Loads the state of the LearnerGroup.

remove_module

Remove a module from the Learners maintained by this LearnerGroup.

save_state

Saves the state of the LearnerGroup.

set_is_module_trainable

Sets the function that determines whether a module is trainable.

set_state

Sets the states of the Learners.

set_weights

Set the weights of the MultiAgentRLModule maintained by each Learner.

shutdown

Shuts down the LearnerGroup.

update

Do one or more gradient based updates to the Learner(s) based on given data.

Attributes

is_local