ray.rllib.algorithms.algorithm_config.AlgorithmConfig.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) LearnerGroup[source]#
- Builds and returns a new LearnerGroup object based on settings in - self.- Parameters:
- env – 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 optional- spacesarg or from- self, the LearnerGroup cannot be created.
- spaces – 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 optional- envarg or from- self, the LearnerGroup cannot be created.
- rl_module_spec – 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.
 
- Returns:
- The newly created - LearnerGroupobject.