mypackage.MyModule

class mypackage.MyModule(n_input, n_batch=0, n_hidden=128, n_latent=10, n_layers=1, dropout_rate=0.1)[source]

Skeleton Variational auto-encoder model.

Here we implement a basic version of scVI’s underlying VAE [Lopez18]. This implementation is for instructional purposes only.

Parameters
n_input : intint

Number of input genes

n_batch : intint (default: 0)

Number of batches, if 0, no batch correction is performed.

n_hidden : intint (default: 128)

Number of nodes per hidden layer

n_latent : intint (default: 10)

Dimensionality of the latent space

n_layers : intint (default: 1)

Number of hidden layers used for encoder and decoder NNs

dropout_rate : floatfloat (default: 0.1)

Dropout rate for neural networks

Methods

generative(z, library)

Runs the generative model.

inference(x)

High level inference method.

loss(tensors, inference_outputs, …[, …])

Compute the loss for a minibatch of data.

marginal_ll(tensors, n_mc_samples)

sample(tensors[, n_samples, library_size])

Generate observation samples from the posterior predictive distribution.