MAF

Implementation of the Masked Autoregressive Flow (MAF) proposed in (https://arxiv.org/abs/1502.03509)

class pythae.models.normalizing_flows.MAFConfig(input_dim=None, n_made_blocks=2, n_hidden_in_made=3, hidden_size=128, include_batch_norm=False)[source]

This is the Masked Autoregressive Flows model configuration instance.

Parameters
  • input_dim (tuple) – The input data dimension. Default: None.

  • n_made_blocks (int) – The number of MADE model to consider in the MAF. Default: 2.

  • n_hidden_in_made (int) – The number of hidden layers in the MADE models. Default: 3.

  • hidden_size (list) – The number of unit in each hidder layer. The same number of units is used across the n_hidden_in_made and n_made_blocks

  • include_batch_norm (bool) – Whether to include batch normalization after each MADE layers. Default: False.

class pythae.models.normalizing_flows.MAF(model_config)[source]

Masked Autoregressive Flow.

Parameters

model_config (MAFConfig) – The MAF model configuration setting the main parameters of the model.

forward(x, **kwargs)[source]

The input data is transformed toward the prior

Parameters

inputs (torch.Tensor) – An input tensor

Returns

An instance of ModelOutput containing all the relevant parameters

Return type

ModelOutput

inverse(y, **kwargs)[source]

The prior is transformed toward the input data

Parameters

inputs (torch.Tensor) – An input tensor

Returns

An instance of ModelOutput containing all the relevant parameters

Return type

ModelOutput