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

LearnerGroup.get_state(components: Container[str] | None = None, *, inference_only: bool = False, module_ids: Container[str] = None) Dict[str, Any][source]#

Get the states of this LearnerGroup.

Contains the Learners’ state (which should be the same across Learners) and some other information.

Parameters:
  • components – An optional list of string keys to be included in the returned state. This might be useful, if getting certain components of the state is expensive (e.g. reading/compiling the weights of a large NN) and at the same time, these components are not required by the caller.

  • inference_only – Return weights with workers that keep inference-only modules. This is needed for algorithms in the new stack that use inference-only modules. In this case only a part of the parameters are synced to the workers. Default is False.

  • module_ids – Optional container of ModuleIDs to be returned only within the state dict. If None (default), all module IDs’ weights are returned.

Returns:

The state dict mapping str keys to state information.