docstr: Create separate optimizers for actor & critic losses.
docstr_tok: ["Create","separate","optimizers","for","actor","&","critic","losses","."]
code: def optimizer(
      self,
  ) -> List["torch.optim.Optimizer"]:
      """Create separate optimizers for actor & critic losses."""
  
      # Set epsilons to match tf.keras.optimizers.Adam's epsilon default.
      self._actor_optimizer = torch.optim.Adam(
          params=self.model.policy_variables(),
          lr=self.config["actor_lr"],
          eps=1e-7,
      )
  
      self._critic_optimizer = torch.optim.Adam(
          params=self.model.q_variables(),
          lr=self.config["critic_lr"],
          eps=1e-7,
      )
  
      # Return them in the same order as the respective loss terms are returned.
      return [self._actor_optimizer, self._critic_optimizer]
  
imports: import logging
  from typing import Any, Dict, List, Optional, Tuple, Type
  import gymnasium
  from rllib_ddpg.ddpg.utils import make_ddpg_models, validate_spaces
  import ray
  from ray.rllib.algorithms.dqn.dqn_tf_policy import PRIO_WEIGHTS, postprocess_nstep_and_prio
  from ray.rllib.evaluation import Episode
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.torch.torch_action_dist import TorchDeterministic, TorchDirichlet, TorchDistributionWrapper
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_mixins import TargetNetworkMixin
  from ray.rllib.policy.torch_policy_v2 import TorchPolicyV2
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.metrics.learner_info import LEARNER_STATS_KEY
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.spaces.simplex import Simplex
  from ray.rllib.utils.torch_utils import apply_grad_clipping, concat_multi_gpu_td_errors, huber_loss, l2_loss
  from ray.rllib.utils.typing import AlgorithmConfigDict, ModelGradients, TensorType
label_desc: Use image node_id 3 for calling the DDPGTorchPolicy obj's underlying member method code with example usage: obj.optimizer() and returns: list