class_docstr: A ResNet decoder suited for CELEBA and Vector Quantized VAE models.
  
  .. code-block::
  
      >>> from pythae.models.nn.benchmarks.celeba import Decoder_ResNet_VQVAE_CELEBA
      >>> from pythae.models import VQVAEConfig
      >>> model_config = VQVAEConfig(input_dim=(3, 64, 64), latent_dim=16)
      >>> decoder = Decoder_ResNet_VQVAE_CELEBA(model_config)
      >>> decoder
      ... Decoder_ResNet_VQVAE_CELEBA(
      ...   (layers): ModuleList(
      ...     (0): ConvTranspose2d(16, 128, kernel_size=(1, 1), stride=(1, 1))
      ...     (1): ConvTranspose2d(128, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      ...     (2): Sequential(
      ...       (0): ResBlock(
      ...         (conv_block): Sequential(
      ...           (0): ReLU()
      ...           (1): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      ...           (2): ReLU()
      ...           (3): Conv2d(32, 128, kernel_size=(1, 1), stride=(1, 1))
      ...         )
      ...       )
      ...       (1): ResBlock(
      ...         (conv_block): Sequential(
      ...           (0): ReLU()
      ...           (1): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      ...           (2): ReLU()
      ...           (3): Conv2d(32, 128, kernel_size=(1, 1), stride=(1, 1))
      ...         )
      ...       )
      ...       (2): ResBlock(
      ...         (conv_block): Sequential(
      ...           (0): ReLU()
      ...           (1): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      ...           (2): ReLU()
      ...           (3): Conv2d(32, 128, kernel_size=(1, 1), stride=(1, 1))
      ...         )
      ...       )
      ...       (3): ResBlock(
      ...         (conv_block): Sequential(
      ...           (0): ReLU()
      ...           (1): Conv2d(128, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      ...           (2): ReLU()
      ...           (3): Conv2d(32, 128, kernel_size=(1, 1), stride=(1, 1))
      ...         )
      ...       )
      ...     )
      ...     (3): Sequential(
      ...       (0): ConvTranspose2d(128, 128, kernel_size=(5, 5), stride=(2, 2), padding=(1, 1))
      ...     )
      ...     (4): Sequential(
      ...       (0): ConvTranspose2d(128, 64, kernel_size=(5, 5), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
      ...     )
      ...     (5): Sequential(
      ...       (0): ConvTranspose2d(64, 3, kernel_size=(4, 4), stride=(2, 2), padding=(1, 1))
      ...       (1): Sigmoid()
      ...     )
      ...   )
      ... )
  
  
  and then passed to a :class:`pythae.models` instance
  
      >>> from pythae.models import VQVAE
      >>> model = VQVAE(model_config=model_config, decoder=decoder)
      >>> model.decoder == decoder
      ... True
  
  .. note::
  
      Please note that this decoder is suitable for **all** models.
  
      .. code-block::
  
          >>> import torch
          >>> input = torch.randn(2, 16, 4, 4)
          >>> out = decoder(input)
          >>> out.reconstruction.shape
          ... torch.Size([2, 3, 64, 64])
code: def __init__(self, args: BaseAEConfig):
      BaseDecoder.__init__(self)
  
      self.input_dim = (3, 64, 64)
      self.latent_dim = args.latent_dim
      self.n_channels = 3
  
      layers = nn.ModuleList()
  
      layers.append(nn.ConvTranspose2d(self.latent_dim, 128, 1, 1))
  
      layers.append(nn.ConvTranspose2d(128, 128, 3, 2, padding=1))
  
      layers.append(
          nn.Sequential(
              ResBlock(in_channels=128, out_channels=32),
              ResBlock(in_channels=128, out_channels=32),
          )
      )
  
      layers.append(
          nn.Sequential(nn.ConvTranspose2d(128, 128, 5, 2, padding=1))
      )
  
      layers.append(
          nn.Sequential(
              nn.ConvTranspose2d(
                  128, 64, 5, 2, padding=1, output_padding=1
              )
          )
      )
  
      layers.append(
          nn.Sequential(
              nn.ConvTranspose2d(64, self.n_channels, 4, 2, padding=1),
              nn.Sigmoid(),
          )
      )
  
      self.layers = layers
      self.depth = len(layers)
  
imports: from typing import List
  import torch
  import torch.nn
  from ....base import BaseAEConfig
  from ....base.base_utils import ModelOutput
  from ...base_architectures import BaseDecoder, BaseEncoder
  from ..utils import ResBlock
label_desc: Use image node_id 1 to create a new Decoder_ResNet_VQVAE_CELEBA object from inherited base classes: BaseDecoder with example: obj = Decoder_ResNet_VQVAE_CELEBA(args)