scvi.external.cellassign.CellAssignModule#
- class scvi.external.cellassign.CellAssignModule(n_genes, rho, basis_means, b_g_0=None, random_b_g_0=True, n_batch=0, n_cats_per_cov=None, n_continuous_cov=0)[source]#
Bases:
BaseModuleClass
Model for CellAssign.
- Parameters:
n_genes (int) – Number of input genes
n_labels – Number of input cell types
rho (Tensor) – Binary matrix of cell type markers
basis_means (Tensor) – Basis means numpy array
b_g_0 (Optional[Tensor]) – Base gene expression tensor. If
None
, use randomly initializedb_g_0
.random_b_g_0 (bool) – Override to enforce randomly initialized
b_g_0
. IfTrue
, use random default, ifFalse
defaults tob_g_0
.n_batch (int) – Number of batches, if 0, no batch correction is performed.
n_cats_per_cov (Optional[Iterable[int]]) – Number of categories for each extra categorical covariate
n_continuous_cov (int) – Number of continuous covariates
Attributes table#
Methods table#
|
Run the generative model. |
Run the recognition model. |
|
|
Compute the loss. |
|
Sample from the posterior distribution. |
Attributes#
training
Methods#
generative
inference
- CellAssignModule.inference()[source]#
Run the recognition model.
In the case of variational inference, this function will perform steps related to computing variational distribution parameters. In a VAE, this will involve running data through encoder networks.
This function should return a dictionary with str keys and
Tensor
values.
loss
- CellAssignModule.loss(tensors, inference_outputs, generative_outputs, n_obs=1.0)[source]#
Compute the loss.
- Parameters:
n_obs (int) –
sample