code: def ae(self, ae_config, custom_encoder, custom_decoder, request):
      # randomized
  
      alpha = request.param
  
      if alpha < 0.25:
          if isinstance(ae_config, VAEConfig):
              model = VAE(ae_config)
          else:
              model = AE(ae_config)
  
      elif 0.25 <= alpha < 0.5:
          if isinstance(ae_config, VAEConfig):
              model = VAE(ae_config, encoder=custom_encoder)
          else:
              model = AE(ae_config, encoder=custom_encoder)
  
      elif 0.5 <= alpha < 0.75:
          if isinstance(ae_config, VAEConfig):
              model = VAE(ae_config, decoder=custom_decoder)
          else:
              model = AE(ae_config, decoder=custom_decoder)
  
      else:
          if isinstance(ae_config, VAEConfig):
              model = VAE(
                  ae_config,
                  encoder=custom_encoder,
                  decoder=custom_decoder,
              )
          else:
              model = AE(
                  ae_config,
                  encoder=custom_encoder,
                  decoder=custom_decoder,
              )
  
      return model
  
imports: import os
  from copy import deepcopy
  import pytest
  import torch
  from pythae.customexception import ModelError
  from pythae.models import AE, RHVAE, VAE, AEConfig, RHVAEConfig, VAEConfig
  from pythae.trainers import BaseTrainer, BaseTrainerConfig
  from tests.data.custom_architectures import *
label_desc: Use image node_id 5 for calling the Test_Main_Training obj's underlying member method code with example usage: obj.ae(ae_config, custom_encoder, custom_decoder, request) and returns: model