Shortcuts

CIFAR100DataModule

class torch_uncertainty.datamodules.CIFAR100DataModule(root, batch_size, eval_ood=False, val_split=None, cutout=None, randaugment=False, auto_augment=None, test_alt=None, corruption_severity=1, num_dataloaders=1, num_workers=1, pin_memory=True, persistent_workers=True)[source]

DataModule for CIFAR100.

Parameters:
  • root (str) – Root directory of the datasets.

  • eval_ood (bool) – Whether to evaluate out-of-distribution performance.

  • batch_size (int) – Number of samples per batch.

  • val_split (float) – Share of samples to use for validation. Defaults to 0.0.

  • cutout (int) – Size of cutout to apply to images. Defaults to None.

  • randaugment (bool) – Whether to apply RandAugment. Defaults to False.

  • auto_augment (str) – Which auto-augment to apply. Defaults to None.

  • test_alt (str) – Which test set to use. Defaults to None.

  • corruption_severity (int) – Severity of corruption to apply to CIFAR100-C. Defaults to 1.

  • num_dataloaders (int) – Number of dataloaders to use. Defaults to 1.

  • num_workers (int) – Number of workers to use for data loading. Defaults to 1.

  • pin_memory (bool) – Whether to pin memory. Defaults to True.

  • persistent_workers (bool) – Whether to use persistent workers. Defaults to True.

test_dataloader()[source]

Get test dataloaders.

Returns:

test set for in distribution data and out-of-distribution data.

Return type:

List[DataLoader]

train_dataloader()[source]

Get the training dataloader for CIFAR100.

Returns:

CIFAR100 training dataloader.

Return type:

DataLoader