PixelCNN

Implementation of PixelCNN model proposed in (https://arxiv.org/abs/1601.06759)

class pythae.models.normalizing_flows.PixelCNNConfig(input_dim=None, n_embeddings=256, n_layers=10, kernel_size=5)[source]

This is the PixelCNN model configuration instance.

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

  • n_embeddings (int) – The number of possible values for the image. Default: 256.

  • n_layers (int) – The number of convolutional layers in the model. Default: 10.

  • kernel_size (int) – The kernel size in the convolutional layers. It must be odd. Default: 5

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

Pixel CNN model.

Parameters

model_config (PixelCNNConfig) – The PixelCNN model configuration setting the main parameters of the model.

forward(inputs, **kwargs)[source]

The input data is transformed an output image.

Parameters

inputs (torch.Tensor) – An input tensor image. Be carefull it must be in range [0-max_channels_values] (i.e. [0-256] for RGB images) and shaped [B x C x H x W].

Returns

An instance of ModelOutput containing all the relevant parameters

Return type

ModelOutput