ray.rllib.core.learner.learner.LearnerSpec
ray.rllib.core.learner.learner.LearnerSpec#
- class ray.rllib.core.learner.learner.LearnerSpec(learner_class: Type[ray.rllib.core.learner.learner.Learner], module_spec: Optional[Union[ray.rllib.core.rl_module.rl_module.SingleAgentRLModuleSpec, ray.rllib.core.rl_module.marl_module.MultiAgentRLModuleSpec]] = None, module: Optional[ray.rllib.core.rl_module.rl_module.RLModule] = None, learner_group_scaling_config: ray.rllib.core.learner.scaling_config.LearnerGroupScalingConfig = <factory>, learner_hyperparameters: ray.rllib.core.learner.learner.LearnerHyperparameters = <factory>, framework_hyperparameters: ray.rllib.core.learner.learner.FrameworkHyperparameters = <factory>)[source]#
Bases:
objectThe spec for constructing Learner actors.
- Parameters
learner_class – The Learner class to use.
module_spec – The underlying (MA)RLModule spec to completely define the module.
module – Alternatively the RLModule instance can be passed in directly. This only works if the Learner is not an actor.
backend_config – The backend config for properly distributing the RLModule.
learner_hyperparameters – The extra config for the loss/additional update. This should be a subclass of LearnerHyperparameters. This is useful for passing in algorithm configs that contains the hyper-parameters for loss computation, change of training behaviors, etc. e.g lr, entropy_coeff.
Methods
build()Builds the Learner instance.
Returns the parameters than be passed to the Learner constructor.
Attributes