load_dataset#
- load_dataset(train: bool = True, batch_size: Optional[int] = None, shuffle: bool = False, pin_memory: bool = True, object_type: typing_extensions.Literal[VisionData, DataLoader] = 'DataLoader', use_iterable_dataset: bool = False, n_samples=None, device: Union[str, device] = 'cpu') Union[DataLoader, VisionData] [source]#
Download MNIST dataset.
- Parameters
- trainbool, defaultTrue
Train or Test dataset
- batch_size: int, optional
how many samples per batch to load
- shufflebool , defaultFalse
to reshuffled data at every epoch or not, cannot work with use_iterable_dataset=True
- pin_memorybool, defaultTrue
If
True
, the data loader will copy Tensors into CUDA pinned memory before returning them.- object_typeLiteral[Dataset, DataLoader], default ‘DataLoader’
object type to return. if ‘VisionData’ then
deepchecks.vision.VisionData
will be returned, if ‘DataLoader’ thentorch.utils.data.DataLoader
- use_iterable_datasetbool, default False
if True, will use
IterableTorchMnistDataset
instead ofTorchMnistDataset
- n_samplesint, optional
Only relevant for loading a VisionData. Number of samples to load. Return the first n_samples if shuffle is False otherwise selects n_samples at random. If None, returns all samples.
- devicet.Union[str, torch.device], default‘cpu’
device to use in tensor calculations
- Returns
- ——-
- Union[:obj:`deepchecks.vision.VisionData`, :obj:`torch.utils.data.DataLoader`]
depending on the
object_type
parameter value, instance ofdeepchecks.vision.VisionData
ortorch.utils.data.DataLoader
will be returned