scvelo.tl.VELOVI.get_latent_representation

VELOVI.get_latent_representation(adata=None, indices=None, give_mean=True, mc_samples=5000, batch_size=None, return_dist=False)

Return the latent representation for each cell.

This is typically denoted as \(z_n\).

Parameters
adata : AnnData, None

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

indices : Sequence[int], None

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

give_mean : bool

Give mean of distribution or sample from it.

mc_samples : int

For distributions with no closed-form mean (e.g., logistic normal), how many Monte Carlo samples to take for computing mean.

batch_size : int, None

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

return_dist : bool

Return (mean, variance) of distributions instead of just the mean. If True, ignores give_mean and mc_samples. In the case of the latter, mc_samples is used to compute the mean of a transformed distribution. If return_dist is true the untransformed mean and variance are returned.

Return type

ndarray, Tuple[ndarray, ndarray]

Returns

Low-dimensional representation for each cell or a tuple containing its mean and variance.