scvi.external.decipher.DecipherPyroModule#

class scvi.external.decipher.DecipherPyroModule(dim_genes, dim_v=2, dim_z=10, layers_v_to_z=(64,), layers_z_to_x=(), beta=0.1)[source]#

Bases: PyroBaseModuleClass

Pyro Module for the Decipher model.

This module implements the Decipher model for dimensionality reduction and interpretable representation learning in single-cell RNA sequencing data.

Parameters:
dim_genes int

Number of genes (features) in the dataset.

dim_v int (default: 2)

Dimension of the interpretable latent space v.

dim_z int (default: 10)

Dimension of the intermediate latent space z.

layers_v_to_z Sequence[int] (default: (64,))

Hidden layer sizes for the v to z decoder network.

layers_z_to_x Sequence[int] (default: ())

Hidden layer sizes for the z to x decoder network.

beta float (default: 0.1)

Regularization parameter for the KL divergence.

Attributes table#

Methods table#

guide(x[, beta])

model(x[, beta])

predictive_log_likelihood(x[, n_samples])

Calculate the predictive log-likelihood for a Decipher module.

Attributes#

DecipherPyroModule.device#
DecipherPyroModule.training: bool#

Methods#

DecipherPyroModule.guide(x, beta=None)[source]#
DecipherPyroModule.model(x, beta=None)[source]#
DecipherPyroModule.predictive_log_likelihood(x, n_samples=5)[source]#

Calculate the predictive log-likelihood for a Decipher module.

This function performs multiple runs through the dataloader to obtain an empirical estimate of the predictive log-likelihood. It calculates the log-likelihood for each run and returns the average. The beta parameter of the Decipher module is temporarily modified and restored even if an exception occurs. Used by default as an early stopping criterion.

Parameters:
x Tensor

Batch of data to compute the log-likelihood for.

n_samples int, optional (default: 5)

Number of passes through the dataloader (default is 5).

Returns:

float The average estimated predictive log-likelihood across multiple runs.