code: def trainer(
      self,
      ae,
      train_dataset,
      optimizer_config,
      scheduler_config,
      training_configs,
  ):
      training_configs.autoencoder_optimizer_cls = optimizer_config[
          "autoencoder_optimizer_cls"
      ]
      training_configs.autoencoder_optimizer_params = optimizer_config[
          "autoencoder_optimizer_params"
      ]
      training_configs.discriminator_optimizer_cls = optimizer_config[
          "discriminator_optimizer_cls"
      ]
      training_configs.discriminator_optimizer_params = (
          optimizer_config["discriminator_optimizer_params"]
      )
      training_configs.autoencoder_scheduler_cls = scheduler_config[
          "autoencoder_scheduler_cls"
      ]
      training_configs.autoencoder_scheduler_params = scheduler_config[
          "autoencoder_scheduler_params"
      ]
      training_configs.discriminator_scheduler_cls = scheduler_config[
          "discriminator_scheduler_cls"
      ]
      training_configs.discriminator_scheduler_params = (
          scheduler_config["discriminator_scheduler_params"]
      )
  
      trainer = AdversarialTrainer(
          model=ae,
          train_dataset=train_dataset,
          eval_dataset=train_dataset,
          training_config=training_configs,
      )
  
      trainer.prepare_training()
  
      return trainer
  
imports: import os
  from copy import deepcopy
  import pytest
  import torch
  from pythae.models import Adversarial_AE, Adversarial_AE_Config
  from pythae.trainers import AdversarialTrainer, AdversarialTrainerConfig
  from tests.data.custom_architectures import *
label_desc: Use image node_id 9 for calling the Test_Main_Training obj's underlying member method code with example usage: obj.trainer(ae, train_dataset, optimizer_config, scheduler_config, training_configs) and returns: trainer