class scvi.nn.Decoder(n_input, n_output, n_cat_list=None, n_layers=1, n_hidden=128, **kwargs)[source]

Bases: torch.nn.modules.module.Module

Decodes data from latent space to data space.

n_input dimensions to n_output dimensions using a fully-connected neural network of n_hidden layers. Output is the mean and variance of a multivariate Gaussian

n_input : intint

The dimensionality of the input (latent space)

n_output : intint

The dimensionality of the output (data space)

n_cat_list : Iterable[int] | NoneOptional[Iterable[int]] (default: None)

A list containing the number of categories for each category of interest. Each category will be included using a one-hot encoding

n_layers : intint (default: 1)

The number of fully-connected hidden layers

n_hidden : intint (default: 128)

The number of nodes per hidden layer


Dropout rate to apply to each of the hidden layers


Keyword args for FCLayers



forward(x, *cat_list)

The forward computation for a single sample.