ray.rllib.core.learner.learner.LearnerSpec#

class ray.rllib.core.learner.learner.LearnerSpec(learner_class: ~typing.Type[~ray.rllib.core.learner.learner.Learner], module_spec: ~ray.rllib.core.rl_module.rl_module.SingleAgentRLModuleSpec | ~ray.rllib.core.rl_module.marl_module.MultiAgentRLModuleSpec = None, module: ~ray.rllib.core.rl_module.rl_module.RLModule | None = 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]#

The 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.

get_params_dict

Returns the parameters than be passed to the Learner constructor.

Attributes

module

module_spec

learner_class

learner_group_scaling_config

learner_hyperparameters

framework_hyperparameters