rllib/contrib/maddpg/maddpg.py
def validate_config(self, config: TrainerConfigDict) -> None:
        """Adds the `before_learn_on_batch` hook to the config.

        This hook is called explicitly prior to TrainOneStep() in the execution
        setups for DQN and APEX.
        """
        # Call super's validation method.
        super().validate_config(config)

        def f(batch, workers, config):
            policies = dict(
                workers.local_worker().foreach_policy_to_train(lambda p, i: (i, p))
            )
            return before_learn_on_batch(batch, policies, config["train_batch_size"])

        config["before_learn_on_batch"] = f
Adds the `before_learn_on_batch` hook to the config.

        This hook is called explicitly prior to TrainOneStep() in the execution
        setups for DQN and APEX.
        
Adds the `before_learn_on_batch` hook to the config.
This hook is called explicitly prior to TrainOneStep() in the execution
setups for DQN and APEX.
Adds the ` before_learn_on_batch ` hook to the config . This hook is called explicitly prior to TrainOneStep () in the execution setups for DQN and APEX .
def validate_config(self, config: TrainerConfigDict) -> None:
        super().validate_config(config)
        def f(batch, workers, config):
            policies = dict(
                workers.local_worker().foreach_policy_to_train(lambda p, i: (i, p))
            )
            return before_learn_on_batch(batch, policies, config["train_batch_size"])
        config["before_learn_on_batch"] = f
def validate_config ( self , config : TrainerConfigDict ) -> None : super ( ) . validate_config ( config ) def f ( batch , workers , config ) : policies = dict ( workers . local_worker ( ) . foreach_policy_to_train ( lambda p , i : ( i , p ) ) ) return before_learn_on_batch ( batch , policies , config [ "train_batch_size" ] ) config [ "before_learn_on_batch" ] = f
Adds the `before_learn_on_batch` hook to the config.
Adds the ` before_learn_on_batch ` hook to the config .
"""Adds the `before_learn_on_batch` hook to the config.

        This hook is called explicitly prior to TrainOneStep() in the execution
        setups for DQN and APEX.
        """ # Call super's validation method.
self
config
TrainerConfigDict