TinyImageNetDataModule#
- class torch_uncertainty.datamodules.TinyImageNetDataModule(root, batch_size, eval_batch_size=None, eval_ood=False, eval_shift=False, shift_severity=1, val_split=None, num_tta=1, postprocess_set='val', train_transform=None, test_transform=None, ood_ds='svhn', interpolation='bilinear', basic_augment=True, rand_augment_opt=None, num_workers=1, pin_memory=True, persistent_workers=True)[source]#
DataModule for the Tiny-ImageNet dataset.
This datamodule uses Tiny-ImageNet as In-distribution dataset, OpenImage-O, ImageNet-0, SVHN or DTD as Out-of-distribution dataset and Tiny-ImageNet-C as shifted dataset.
- Parameters:
root (
str|Path) – Root directory of the datasets.batch_size (
int) – Number of samples per batch during training.eval_batch_size (
int|None) – Number of samples per batch during evaluation (val and test). Set tobatch_sizeifNone. Defaults toNone.eval_ood (
bool) – Whether to evaluate out-of-distribution performance. Defaults toFalse.eval_shift (
bool) – Whether to evaluate on shifted data. Defaults toFalse.num_tta (
int) – Number of test-time augmentations (TTA). Defaults to1(no TTA).shift_severity (
int) – Severity of the shift. Defaults to1.val_split (float or Path) – Share of samples to use for validation or path to a yaml file containing a list of validation images ids. Defaults to
0.0.postprocess_set (
Literal['val','test']) – The post-hoc calibration dataset to use for the post-processing method. Defaults toval.train_transform (
Module|None) – Custom training transform. Defaults toNone. If not provided, a default transform is used.test_transform (
Module|None) – Custom test transform. Defaults toNone. If not provided, a default transform is used.ood_ds (
str) – Which out-of-distribution dataset to use. Defaults to"openimage-o".test_alt – Which test set to use. Defaults to
None.procedure – Which procedure to use. Defaults to
None.train_size – Size of training images. Defaults to
224.interpolation (
str) – Interpolation method for the Resize Crops. Defaults to"bilinear".basic_augment (
bool) – Whether to apply base augmentations. Defaults toTrue.rand_augment_opt (
str|None) – Which RandAugment to use. Defaults toNone.num_workers (
int) – Number of workers to use for data loading. Defaults to1.pin_memory (
bool) – Whether to pin memory. Defaults toTrue.persistent_workers (
bool) – Whether to use persistent workers. Defaults toTrue.