cellmap_data.dataloader#
Classes
|
Initialize the CellMapDataLoader |
- class cellmap_data.dataloader.CellMapDataLoader(dataset: CellMapMultiDataset | CellMapDataset | Subset | CellMapDatasetWriter, classes: Iterable[str], batch_size: int = 1, num_workers: int = 0, weighted_sampler: bool = False, sampler: Sampler | Callable | None = None, is_train: bool = True, rng: Generator | None = None, **kwargs)[source]#
Initialize the CellMapDataLoader
- Parameters:
dataset (CellMapMultiDataset | CellMapDataset | CellMapSubset) – The dataset to load.
classes (Iterable[str]) – The classes to load.
batch_size (int) – The batch size.
num_workers (int) – The number of workers to use.
weighted_sampler (bool) – Whether to use a weighted sampler. Defaults to False.
sampler (Sampler | Callable | None) – The sampler to use.
is_train (bool) – Whether the data is for training and thus should be shuffled.
rng (Optional[torch.Generator]) – The random number generator to use.
**kwargs – Additional arguments to pass to the DataLoader.