mypackage.MyModule
- class mypackage.MyModule(n_input, library_log_means, library_log_vars, 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 :
int
Number of input genes
- library_log_means :
ndarray
1 x n_batch array of means of the log library sizes. Parameterizes prior on library size if not using observed library size.
- library_log_vars :
ndarray
1 x n_batch array of variances of the log library sizes. Parameterizes prior on library size if not using observed library size.
- n_batch :
int
(default:0
) Number of batches, if 0, no batch correction is performed.
- n_hidden :
int
(default:128
) Number of nodes per hidden layer
- n_latent :
int
(default:10
) Dimensionality of the latent space
- n_layers :
int
(default:1
) Number of hidden layers used for encoder and decoder NNs
- dropout_rate :
float
(default:0.1
) Dropout rate for neural networks
- n_input :
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.