rllib/policy/torch_policy.py
def optimizer(
        self,
    ) -> Union[List["torch.optim.Optimizer"], "torch.optim.Optimizer"]:
        """Custom the local PyTorch optimizer(s) to use.

        Returns:
            The local PyTorch optimizer(s) to use for this Policy.
        """
        if hasattr(self, "config"):
            optimizers = [
                torch.optim.Adam(self.model.parameters(), lr=self.config["lr"])
            ]
        else:
            optimizers = [torch.optim.Adam(self.model.parameters())]
        if getattr(self, "exploration", None):
            optimizers = self.exploration.get_exploration_optimizer(optimizers)
        return optimizers
Custom the local PyTorch optimizer(s) to use.

        Returns:
            The local PyTorch optimizer(s) to use for this Policy.
        
Custom the local PyTorch optimizer(s) to use.
Custom the local PyTorch optimizer ( s ) to use .
def optimizer(
        self,
    ) -> Union[List["torch.optim.Optimizer"], "torch.optim.Optimizer"]:
        if hasattr(self, "config"):
            optimizers = [
                torch.optim.Adam(self.model.parameters(), lr=self.config["lr"])
            ]
        else:
            optimizers = [torch.optim.Adam(self.model.parameters())]
        if getattr(self, "exploration", None):
            optimizers = self.exploration.get_exploration_optimizer(optimizers)
        return optimizers
def optimizer ( self , ) -> Union [ List [ "torch.optim.Optimizer" ] , "torch.optim.Optimizer" ] : if hasattr ( self , "config" ) : optimizers = [ torch . optim . Adam ( self . model . parameters ( ) , lr = self . config [ "lr" ] ) ] else : optimizers = [ torch . optim . Adam ( self . model . parameters ( ) ) ] if getattr ( self , "exploration" , None ) : optimizers = self . exploration . get_exploration_optimizer ( optimizers ) return optimizers
Custom the local PyTorch optimizer(s) to use.
Custom the local PyTorch optimizer ( s ) to use .
"""Custom the local PyTorch optimizer(s) to use.

        Returns:
            The local PyTorch optimizer(s) to use for this Policy.
        """
The local PyTorch optimizer(s) to use for this Policy.
The local PyTorch optimizer ( s ) to use for this Policy .
self