ray.rllib.core.learner.learner_group.LearnerGroup.__init__#
- LearnerGroup.__init__(*, config: AlgorithmConfig = None, module_spec: SingleAgentRLModuleSpec | MultiAgentRLModuleSpec | None = None, max_queue_len: int = 20, learner_spec=None)[source]#
Initializes a LearnerGroup instance.
- Parameters:
config – The AlgorithmConfig object to use to configure this LearnerGroup. Call the
resources(num_learner_workers=...)
method on your config to specify the number of learner workers to use. Call the same method with argumentsnum_cpus_per_learner_worker
and/ornum_gpus_per_learner_worker
to configure the compute used by each Learner worker in this LearnerGroup. Call thetraining(learner_class=...)
method on your config to specify, which exact Learner class to use. Call therl_module(rl_module_spec=...)
method on your config to set up the specifics for your RLModule to be used in each Learner.module_spec – If not already specified in
config
, a separate overriding RLModuleSpec may be provided via this argument.max_queue_len – The maximum number of batches to queue up if doing async_update. If the queue is full it will evict the oldest batch first.