class_docstr: A Convolutional discriminator suited for MNIST.
  
  
  It can be built as follows:
  
  .. code-block::
  
          >>> from pythae.models.nn.benchmarks.mnist import Discriminator_Conv_MNIST
          >>> from pythae.models import VAEGANConfig
          >>> model_config = VAEGANConfig(input_dim=(1, 28, 28), latent_dim=16)
          >>> discriminator = Discriminator_Conv_MNIST(model_config)
          >>> discriminator
          ... Discriminator_Conv_MNIST(
          ...   (layers): ModuleList(
          ...     (0): Sequential(
          ...       (0): Conv2d(1, 128, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
          ...       (1): ReLU()
          ...     )
          ...     (1): Sequential(
          ...       (0): Conv2d(128, 256, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
          ...       (1): Tanh()
          ...     )
          ...     (2): Sequential(
          ...       (0): Conv2d(256, 512, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
          ...       (1): ReLU()
          ...     )
          ...     (3): Sequential(
          ...       (0): Conv2d(512, 1024, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
          ...       (1): ReLU()
          ...     )
          ...     (4): Sequential(
          ...       (0): Linear(in_features=1024, out_features=1, bias=True)
          ...       (1): Sigmoid()
          ...     )
          ...   )
          ... )
  
  and then passed to a :class:`pythae.models` instance
  
      >>> from pythae.models import VAEGAN
      >>> model = VAEGAN(model_config=model_config, discriminator=discriminator)
      >>> model.discriminator == discriminator
      ... True
class_docstr_tok: ["A","Convolutional","discriminator","suited","for","MNIST",".","It","can","be","built","as","follows",":","..","code-block",":",":",">",">",">","from","pythae.models.nn.benchmarks.mnist","import","Discriminator_Conv_MNIST",">",">",">","from","pythae.models","import","VAEGANConfig",">",">",">","model_config","=","VAEGANConfig","(","input_dim=","(","1",",","28",",","28",")",",","latent_dim=16",")",">",">",">","discriminator","=","Discriminator_Conv_MNIST","(","model_config",")",">",">",">","discriminator","...","Discriminator_Conv_MNIST","(","...","(","layers",")",":","ModuleList","(","...","(","0",")",":","Sequential","(","...","(","0",")",":","Conv2d","(","1",",","128",",","kernel_size=","(","4",",","4",")",",","stride=","(","2",",","2",")",",","padding=","(","1",",","1",")",")","...","(","1",")",":","ReLU","(",")","...",")","...","(","1",")",":","Sequential","(","...","(","0",")",":","Conv2d","(","128",",","256",",","kernel_size=","(","4",",","4",")",",","stride=","(","2",",","2",")",",","padding=","(","1",",","1",")",")","...","(","1",")",":","Tanh","(",")","...",")","...","(","2",")",":","Sequential","(","...","(","0",")",":","Conv2d","(","256",",","512",",","kernel_size=","(","4",",","4",")",",","stride=","(","2",",","2",")",",","padding=","(","1",",","1",")",")","...","(","1",")",":","ReLU","(",")","...",")","...","(","3",")",":","Sequential","(","...","(","0",")",":","Conv2d","(","512",",","1024",",","kernel_size=","(","4",",","4",")",",","stride=","(","2",",","2",")",",","padding=","(","1",",","1",")",")","...","(","1",")",":","ReLU","(",")","...",")","...","(","4",")",":","Sequential","(","...","(","0",")",":","Linear","(","in_features=1024",",","out_features=1",",","bias=True",")","...","(","1",")",":","Sigmoid","(",")","...",")","...",")","...",")","and","then","passed","to","a",":","class",":","`","pythae.models","`","instance",">",">",">","from","pythae.models","import","VAEGAN",">",">",">","model","=","VAEGAN","(","model_config=model_config",",","discriminator=discriminator",")",">",">",">","model.discriminator","==","discriminator","...","True"]
code: def __init__(self, args: dict):
      BaseDiscriminator.__init__(self)
  
      self.input_dim = (1, 28, 28)
      self.latent_dim = args.latent_dim
      self.n_channels = 1
  
      layers = nn.ModuleList()
  
      layers.append(
          nn.Sequential(
              nn.Conv2d(self.n_channels, 128, 4, 2, padding=1),
              # nn.BatchNorm2d(128),
              nn.ReLU(),
          )
      )
  
      layers.append(
          nn.Sequential(
              nn.Conv2d(128, 256, 4, 2, padding=1),
              # nn.BatchNorm2d(256),
              nn.Tanh(),
          )
      )
  
      layers.append(
          nn.Sequential(
              nn.Conv2d(256, 512, 4, 2, padding=1),
              # nn.BatchNorm2d(512),
              nn.ReLU(),
          )
      )
  
      layers.append(
          nn.Sequential(
              nn.Conv2d(512, 1024, 4, 2, padding=1),
              # nn.BatchNorm2d(1024),
              nn.ReLU(),
          )
      )
  
      layers.append(nn.Sequential(nn.Linear(1024, 1), nn.Sigmoid()))
  
      self.layers = layers
      self.depth = len(layers)
  
imports: from typing import List
  import torch
  import torch.nn
  from pythae.models.nn import BaseDecoder, BaseDiscriminator, BaseEncoder
  from ....base import BaseAEConfig
  from ....base.base_utils import ModelOutput
  from ...base_architectures import BaseDecoder, BaseEncoder
label_desc: Use image node_id 1 to create a new Discriminator_Conv_MNIST object from inherited base classes: BaseDiscriminator with example: obj = Discriminator_Conv_MNIST(args)