RAE-GP

This module is the implementation of the Regularized AE with gradient penalty regularization proposed in (https://arxiv.org/abs/1903.12436).

Available samplers

NormalSampler

Samples from a Standard normal distribution in the Autoencoder’s latent space.

GaussianMixtureSampler

Fits a Gaussian Mixture in the Autoencoder’s latent space.

MAFSampler

Fits a Masked Autoregressive Flow in the Autoencoder’s latent space.

IAFSampler

Fits an Inverse Autoregressive Flow in the Autoencoder’s latent space.

class pythae.models.RAE_GP_Config(input_dim=None, latent_dim=10, uses_default_encoder=True, uses_default_decoder=True, embedding_weight=0.0001, reg_weight=1e-07)[source]

RAE_GP config class.

Parameters
  • input_dim (tuple) – The input_data dimension.

  • latent_dim (int) – The latent space dimension. Default: None.

  • embedding_weight (float) – The factor before the L2 embedding regularization term in the loss. Default: 1e-4

  • reg_weight (float) – The factor before the gradient penalty regularization term.

class pythae.models.RAE_GP(model_config, encoder=None, decoder=None)[source]

Regularized Autoencoder with gradient penalty model.

Parameters
  • model_config (RAE_GP_Config) – 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.

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.

forward(inputs, **kwargs)[source]

The input data is encoded and decoded

Parameters

inputs (BaseDataset) – An instance of pythae’s datasets

Returns

An instance of ModelOutput containing all the relevant parameters

Return type

ModelOutput