class_docstr: Trainer using distinct optimizers for the autoencoder and the discriminator.
  
  Args:
      model (BaseAE): The model to train
  
      train_dataset (BaseDataset): The training dataset of type
          :class:`~pythae.data.dataset.BaseDataset`
  
      training_args (AdversarialTrainerConfig): The training arguments summarizing the main
          parameters used for training. If None, a basic training instance of
          :class:`AdversarialTrainerConfig` is used. Default: None.
  
      autoencoder_optimizer (~torch.optim.Optimizer): An instance of `torch.optim.Optimizer`
          used for training the autoencoder. If None, a :class:`~torch.optim.Adam` optimizer is
          used. Default: None.
  
      discriminator_optimizer (~torch.optim.Optimizer): An instance of `torch.optim.Optimizer`
          used for training the discriminator. If None, a :class:`~torch.optim.Adam` optimizer is
          used. Default: None.
code: def set_autoencoder_optimizer(self):
      autoencoder_optimizer_cls = getattr(
          optim, self.training_config.autoencoder_optimizer_cls
      )
  
      if self.training_config.autoencoder_optimizer_params is not None:
          if self.distributed:
              autoencoder_optimizer = autoencoder_optimizer_cls(
                  itertools.chain(
                      self.model.module.encoder.parameters(),
                      self.model.module.decoder.parameters(),
                  ),
                  lr=self.training_config.autoencoder_learning_rate,
                  **self.training_config.autoencoder_optimizer_params,
              )
          else:
              autoencoder_optimizer = autoencoder_optimizer_cls(
                  itertools.chain(
                      self.model.encoder.parameters(),
                      self.model.decoder.parameters(),
                  ),
                  lr=self.training_config.autoencoder_learning_rate,
                  **self.training_config.autoencoder_optimizer_params,
              )
      else:
          if self.distributed:
              autoencoder_optimizer = autoencoder_optimizer_cls(
                  itertools.chain(
                      self.model.module.encoder.parameters(),
                      self.model.module.decoder.parameters(),
                  ),
                  lr=self.training_config.autoencoder_learning_rate,
              )
          else:
              autoencoder_optimizer = autoencoder_optimizer_cls(
                  itertools.chain(
                      self.model.encoder.parameters(),
                      self.model.decoder.parameters(),
                  ),
                  lr=self.training_config.autoencoder_learning_rate,
              )
  
      self.autoencoder_optimizer = autoencoder_optimizer
  
imports: import datetime
  import itertools
  import logging
  import os
  from copy import deepcopy
  from typing import List, Optional
  import torch
  import torch.distributed
  import torch.optim
  import torch.optim.lr_scheduler
  from ...data.datasets import BaseDataset
  from ...models import BaseAE
  from ..base_trainer import BaseTrainer
  from ..trainer_utils import set_seed
  from ..training_callbacks import TrainingCallback
  from .adversarial_trainer_config import AdversarialTrainerConfig
label_desc: Use image node_id 2 for calling the AdversarialTrainer obj's underlying member method code with example usage: obj.set_autoencoder_optimizer() without return types