scvi.dataloaders.ConcatDataLoader#
- class scvi.dataloaders.ConcatDataLoader(adata_manager, indices_list, shuffle=False, batch_size=128, data_and_attributes=None, drop_last=False, distributed_sampler=False, **data_loader_kwargs)[source]#
Bases:
DataLoaderDataLoader that supports a list of list of indices to load.
- Parameters:
- adata_manager
AnnDataManager AnnDataManagerobject that has been created viasetup_anndata.- indices_list
list[list[int]] List where each element is a list of indices 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.- drop_last
bool|int(default:False) If
Trueand the dataset is not evenly divisible bybatch_size, the last incomplete batch is dropped. IfFalseand the dataset is not evenly divisible bybatch_size, then the last batch will be smaller thanbatch_size.- distributed_sampler
bool(default:False) EXPERIMENTALWhether to useBatchDistributedSampleras the sampler. IfTrue,samplermust beNone.- data_loader_kwargs
Keyword arguments for
DataLoader
- adata_manager
Attributes table#
Methods table#
Attributes#
- ConcatDataLoader.dataset#
- ConcatDataLoader.batch_size#
- ConcatDataLoader.num_workers#
- ConcatDataLoader.pin_memory#
- ConcatDataLoader.drop_last#
- ConcatDataLoader.timeout#
- ConcatDataLoader.sampler#
- ConcatDataLoader.pin_memory_device#
- ConcatDataLoader.prefetch_factor#