epiout.autoencoder
Module Contents
Classes
Linear autoencoder for count data with negative binomial likelihood. |
- class epiout.autoencoder.LinearAutoEncoder(bottleneck_size: int, njobs: int = - 1)
Linear autoencoder for count data with negative binomial likelihood.
- Parameters
bottleneck_size – bottleneck size of the autoencoder.
njobs – number of jobs to run in parallel during training.
- init_weights(self, counts, X, metadata=None)
Init layers and their weights with PCA
- log_prob(self, counts, nmean, dispersion)
Log probability of counts given mean and dispersion.
- update_dispersion(self, counts, metadata=None)
Update dispersion parameter of the negative binomial distribution.
- _loss_grad_encoder(self, counts, X, metadata=None)
Loss and gradient functions of the encoder for l-bfgs algorithm.
- _update_encoder(self, counts, X, metadata=None)
- update_encoder(self, counts, X, metadata=None)
Update encoder weights with l-bfgs algorithm.
- _loss_grad_decoder(self, counts, X, metadata=None)
Loss and gradient functions of the decoder for l-bfgs algorithm.
- _update_decoder(self, counts, X, metadata=None)
- update_decoder(self, counts, X, metadata=None)
Update decoder weights with l-bfgs algorithm.
- fit(self, counts, metadata=None, epochs=0, train_encoder=False, train_decoder=False)
- Fit the autoencoder weights by minimizing the negative log likelihood
using alternating optimization updates of the encoder, decoder and dispersion weights.
- __call__(self, counts, metadata=None)
- Predict reconstructed counts with the autoencoder
given counts and metadata.