IAF

Implementation of the Inverse Autoregressive Flows (IAF) proposed in (https://arxiv.org/abs/1606.04934).

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

This is the MADE 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 IAF. 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. Default: 128.

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

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

Inverse Autoregressive Flow.

Parameters

model_config (IAFConfig) – The IAF model configuration setting the main parameters of the model.

forward(x, **kwargs)[source]

The input data is transformed toward the prior (f^{-1})

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 (f)

Parameters

inputs (torch.Tensor) – An input tensor

Returns

An instance of ModelOutput containing all the relevant parameters

Return type

ModelOutput