scvi.core.data_loaders.TotalDataLoader

class scvi.core.data_loaders.TotalDataLoader(model, adata, shuffle=False, indices=None, use_cuda=True, batch_size=256, data_loader_kwargs={})[source]

Extended data loader for totalVI.

Parameters
model : TOTALVAETOTALVAE

A model instance from class TOTALVI

adata : AnnDataAnnData

A registered AnnData object

shuffle : boolbool (default: False)

Specifies if a RandomSampler or a SequentialSampler should be used

indices : ndarray, NoneOptional[ndarray] (default: None)

Specifies how the data should be split with regards to train/test or labelled/unlabelled

use_cuda : boolbool (default: True)

Default: True

data_loader_kwargs

Keyword arguments to passed into the DataLoader

Attributes

indices

Returns the current dataloader indices used by the object.

n_cells

Returns the number of studied cells.

scvi_data_loader_type

Returns the dataloader class name.

Methods

accuracy()

compute_elbo(vae, **kwargs)

Computes the ELBO.

compute_marginal_log_likelihood([…])

Computes a biased estimator for log p(x, y), which is the marginal log likelihood.

compute_reconstruction_error(vae, **kwargs)

Computes log p(x/z), which is the reconstruction error.

elbo()

Returns the Evidence Lower Bound associated to the object.

get_protein_background_mean()

marginal_ll([n_mc_samples])

Estimates the marginal likelihood of the object’s data.

reconstruction_error([mode])

Returns the reconstruction error associated to the object.

sequential([batch_size])

Returns a copy of the object that iterate over the data sequentially.

to_cuda(tensors)

Converts dict of tensors to cuda.

update(data_loader_kwargs)

Updates the dataloader.

update_batch_size(batch_size)

update_sampler_indices(idx)

Updates the data loader indices.