class_docstr: Variational Autoencoder using Adversarial reconstruction loss model.
  
  Args:
      model_config (VAEGANConfig): The Autoencoder configuration setting the main
          parameters of the model.
  
      encoder (BaseEncoder): An instance of BaseEncoder (inheriting from `torch.nn.Module` which
          plays the role of encoder. This argument allows you to use your own neural networks
          architectures if desired. If None is provided, a simple Multi Layer Preception
          (https://en.wikipedia.org/wiki/Multilayer_perceptron) is used. Default: None.
  
      decoder (BaseDecoder): An instance of BaseDecoder (inheriting from `torch.nn.Module` which
          plays the role of decoder. This argument allows you to use your own neural networks
          architectures if desired. If None is provided, a simple Multi Layer Preception
          (https://en.wikipedia.org/wiki/Multilayer_perceptron) is used. Default: None.
  
      discriminator (BaseDiscriminator): An instance of BaseDiscriminator (inheriting from
          `torch.nn.Module` which plays the role of discriminator. This argument allows you to use
          your own neural networks architectures if desired. If None is provided, a simple Multi
          Layer Preception (https://en.wikipedia.org/wiki/Multilayer_perceptron) is used. Default:
          None.
  
  .. note::
      For high dimensional data we advice you to provide you own network architectures. With the
      provided MLP you may end up with a ``MemoryError``.
class_docstr_tok: ["Variational","Autoencoder","using","Adversarial","reconstruction","loss","model",".","Args",":","model_config","(","VAEGANConfig",")",":","The","Autoencoder","configuration","setting","the","main","parameters","of","the","model",".","encoder","(","BaseEncoder",")",":","An","instance","of","BaseEncoder","(","inheriting","from","`","torch.nn.Module","`","which","plays","the","role","of","encoder",".","This","argument","allows","you","to","use","your","own","neural","networks","architectures","if","desired",".","If","None","is","provided",",","a","simple","Multi","Layer","Preception","(","https",":","\/\/en.wikipedia.org\/wiki\/Multilayer_perceptron",")","is","used",".","Default",":","None",".","decoder","(","BaseDecoder",")",":","An","instance","of","BaseDecoder","(","inheriting","from","`","torch.nn.Module","`","which","plays","the","role","of","decoder",".","This","argument","allows","you","to","use","your","own","neural","networks","architectures","if","desired",".","If","None","is","provided",",","a","simple","Multi","Layer","Preception","(","https",":","\/\/en.wikipedia.org\/wiki\/Multilayer_perceptron",")","is","used",".","Default",":","None",".","discriminator","(","BaseDiscriminator",")",":","An","instance","of","BaseDiscriminator","(","inheriting","from","`","torch.nn.Module","`","which","plays","the","role","of","discriminator",".","This","argument","allows","you","to","use","your","own","neural","networks","architectures","if","desired",".","If","None","is","provided",",","a","simple","Multi","Layer","Preception","(","https",":","\/\/en.wikipedia.org\/wiki\/Multilayer_perceptron",")","is","used",".","Default",":","None",".","..","note",":",":","For","high","dimensional","data","we","advice","you","to","provide","you","own","network","architectures",".","With","the","provided","MLP","you","may","end","up","with","a","``","MemoryError","``","."]
docstr: This method is called to set the metric network outputing the
  :math:`L_{\psi_i}` of the metric matrices
  
  Args:
      metric (BaseMetric): The metric module that need to be set to the model.
docstr_tok: ["This","method","is","called","to","set","the","metric","network","outputing","the",":","math",":","`","L_","{","\\psi_i","}","`","of","the","metric","matrices","Args",":","metric","(","BaseMetric",")",":","The","metric","module","that","need","to","be","set","to","the","model","."]
code: def set_discriminator(self, discriminator: BaseDiscriminator) -> None:
      r"""This method is called to set the metric network outputing the
      :math:`L_{\psi_i}` of the metric matrices
  
      Args:
          metric (BaseMetric): The metric module that need to be set to the model.
  
      """
      if not issubclass(type(discriminator), BaseDiscriminator):
          raise BadInheritanceError(
              (
                  "Discriminator must inherit from BaseDiscriminator class from "
                  "pythae.models.base_architectures.BaseDiscriminator. "
                  "Refer to documentation."
              )
          )
  
      self.discriminator = discriminator
  
imports: import inspect
  import logging
  import os
  import warnings
  from copy import deepcopy
  from typing import Optional
  import cloudpickle
  import torch
  import torch.nn.functional
  from ...customexception import BadInheritanceError
  from ...data.datasets import BaseDataset
  from ..base.base_utils import CPU_Unpickler, ModelOutput, hf_hub_is_available
  from ..nn import BaseDecoder, BaseDiscriminator, BaseEncoder
  from ..nn.default_architectures import Discriminator_MLP
  from ..vae import VAE
  from .vae_gan_config import VAEGANConfig
label_desc: Use image node_id 2 for calling the VAEGAN obj's underlying member method code with example usage: obj.set_discriminator(discriminator) without return types