build_learner_group#
- AlgorithmConfig.build_learner_group(*, env: Any | gymnasium.Env | None = None, spaces: Dict[str, Tuple[gymnasium.Space, gymnasium.Space]] | None = None, rl_module_spec: RLModuleSpec | MultiRLModuleSpec | None = None, placement_group: PlacementGroup | None = None) LearnerGroup[source]#
Builds and returns a new LearnerGroup object based on settings in
self.- Parameters:
env (Any | gymnasium.Env | None) – An optional EnvType object (e.g. a gym.Env) useful for extracting space information for the to-be-constructed RLModule inside the LearnerGroup’s Learner workers. Note that if RLlib cannot infer any space information either from this
envarg, from the optionalspacesarg or fromself, the LearnerGroup cannot be created.spaces (Dict[str, Tuple[gymnasium.Space, gymnasium.Space]] | None) – An optional dict mapping ModuleIDs to (observation-space, action-space)-tuples for the to-be-constructed RLModule inside the LearnerGroup’s Learner workers. Note that if RLlib cannot infer any space information either from this
spcesarg, from the optionalenvarg or fromself, the LearnerGroup cannot be created.rl_module_spec (RLModuleSpec | MultiRLModuleSpec | None) – An optional (single-agent or multi-agent) RLModuleSpec to use for the constructed LearnerGroup. If None, RLlib tries to infer the RLModuleSpec using the other information given and stored in this
AlgorithmConfigobject.placement_group (PlacementGroup | None) – An optional
PlacementGroupinstance to place the LearnerGroup’s Learner actors in. If None, the LearnerGroup creates its own placement group.
- Returns:
The newly created
LearnerGroupobject.- Return type: