scvi.dataloaders.SemiSupervisedDataLoader#
- class scvi.dataloaders.SemiSupervisedDataLoader(adata_manager, n_samples_per_label=None, indices=None, shuffle=False, batch_size=128, data_and_attributes=None, drop_last=False, **data_loader_kwargs)[source]#
Bases:
ConcatDataLoaderDataLoader that supports semisupervised training.
- Parameters:
- adata_manager
AnnDataManager AnnDataManagerobject that has been created viasetup_anndata.- n_samples_per_label
int|None(default:None) Number of subsamples for each label class to sample per epoch. By default, there is no label subsampling.
- indices
list[int] |None(default:None) The indices of the observations in the adata to load
- shuffle
bool(default:False) Whether the data should be shuffled
- batch_size
int(default:128) minibatch size to load each iteration
- data_and_attributes
dict|None(default:None) Dictionary with keys representing keys in data registry (
adata_manager.data_registry) and value equal to desired numpy loading type (later made into torch tensor). IfNone, defaults to all registered data.- data_loader_kwargs
Keyword arguments for
DataLoader
- adata_manager
Attributes table#
Methods table#
Resamples the labeled data. |
|
Subsamples each label class by taking up to n_samples_per_label samples per class. |
Attributes#
- SemiSupervisedDataLoader.dataset#
- SemiSupervisedDataLoader.batch_size#
- SemiSupervisedDataLoader.num_workers#
- SemiSupervisedDataLoader.pin_memory#
- SemiSupervisedDataLoader.drop_last#
- SemiSupervisedDataLoader.timeout#
- SemiSupervisedDataLoader.sampler#
- SemiSupervisedDataLoader.pin_memory_device#
- SemiSupervisedDataLoader.prefetch_factor#