class_docstr: Variational Mixture of Posteriors (VAMP) VAE model
  
  Args:
      model_config (VAEConfig): The Variational 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 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.
  
  .. 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","Mixture","of","Posteriors","(","VAMP",")","VAE","model","Args",":","model_config","(","VAEConfig",")",":","The","Variational","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","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",".","..","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","``","."]
code: def __init__(
      self,
      model_config: VAMPConfig,
      encoder: Optional[BaseEncoder] = None,
      decoder: Optional[BaseDecoder] = None,
  ):
      VAE.__init__(
          self,
          model_config=model_config,
          encoder=encoder,
          decoder=decoder,
      )
  
      self.model_name = "VAMP"
  
      self.number_components = model_config.number_components
  
      if model_config.input_dim is None:
          raise AttributeError(
              "Provide input dim to build pseudo input network"
          )
  
      linear_layer = nn.Linear(
          model_config.number_components,
          int(np.prod(model_config.input_dim)),
      )
  
      self.pseudo_inputs = nn.Sequential(
          linear_layer, nn.Hardtanh(0.0, 1.0)
      )
  
      self.idle_input = torch.eye(
          model_config.number_components, requires_grad=False
      ).to(self.device)
      self.linear_scheduling = self.model_config.linear_scheduling_steps
  
file_path: benchmark_VAE/src/pythae/models/vamp/vamp_model.py
imports: from typing import Optional
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from ...data.datasets import BaseDataset
  from ..base.base_utils import ModelOutput
  from ..nn import BaseDecoder, BaseEncoder
  from ..vae import VAE
  from .vamp_config import VAMPConfig
label_desc: Use image node_id 1 to create a new VAMP object from inherited base classes: VAE with example: obj = VAMP(model_config, encoder, decoder)