DeltaTopic.nn.module.DeltaTopic_module
- class DeltaTopic.nn.module.DeltaTopic_module(*args: Any, **kwargs: Any)[source]
DeltaTopic module.
- Parameters:
n_genes – number of genes
n_latent – dimension of latent space
n_layers_encoder_individual – number of individual layers in the encoder
dim_hidden_encoder – dimension of the hidden layers in the encoder
pip0_rho – scaling factor for rho loss, default 0.1
pip0_delta – scaling factor for delta loss, default 0.1
kl_weight_beta – scaling factor for KL, default 1.0
log_variational – Log(data+1) prior to encoding for numerical stability. Not normalization.
- __init__(n_genes: int, n_latent: int = 10, n_layers_encoder_individual: int = 2, dim_hidden_encoder: int = 128, pip0_rho: float = 0.1, pip0_delta: float = 0.1, kl_weight_beta: float = 1.0, log_variational: bool = True)[source]
Methods
__init__(n_genes[, n_latent, ...])dir_llik(xx, aa)Return the Dirichlet log-likelihood for a batch.
forward(tensors[, ...])Forward pass through the network.
generative(z)Run the generative model.
get_reconstruction_loss(x, y)Returns the reconstruction loss for the given batch.
inference(x, y)Run the inference (recognition) model.
loss(tensors, inference_outputs, ...[, ...])Aggregate the kl and likelihood to form the loss.
sample(*args, **kwargs)Generate samples from the learned model.
sample_from_posterior_z(x, y[, ...])sample from the posterior of latent space z