scvi.model.SCANVI.get_latent_library_size

SCANVI.get_latent_library_size(adata=None, indices=None, give_mean=True, batch_size=None)

Returns the latent library size for each cell.

This is denoted as \(\ell_n\) in the scVI paper.

Parameters
adata : AnnData | NoneOptional[AnnData] (default: None)

AnnData object with equivalent structure to initial AnnData. If None, defaults to the AnnData object used to initialize the model.

indices : Sequence[int] | NoneOptional[Sequence[int]] (default: None)

Indices of cells in adata to use. If None, all cells are used.

give_mean : boolbool (default: True)

Return the mean or a sample from the posterior distribution.

batch_size : int | NoneOptional[int] (default: None)

Minibatch size for data loading into model. Defaults to scvi.settings.batch_size.

Return type

ndarrayndarray