Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.. [2] Krizhevsky A. (2009). Learning Multiple Layers of Features from Tiny
Images. (https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf)
"""
def __init__(self, root, num_classes_per_task=None, meta_train=False,
meta_val=False, meta_test=False, meta_split=None,
transform=None, target_transform=None, dataset_transform=None,
class_augmentations=None, download=False):
dataset = FC100ClassDataset(root, meta_train=meta_train,
meta_val=meta_val, meta_test=meta_test, meta_split=meta_split,
transform=transform, class_augmentations=class_augmentations,
download=download)
super(FC100, self).__init__(dataset, num_classes_per_task,
target_transform=target_transform, dataset_transform=dataset_transform)
class FC100ClassDataset(CIFAR100ClassDataset):
subfolder = 'fc100'
def __init__(self, root, meta_train=False, meta_val=False, meta_test=False,
meta_split=None, transform=None, class_augmentations=None,
download=False):
super(FC100ClassDataset, self).__init__(root, meta_train=meta_train,
meta_val=meta_val, meta_test=meta_test, meta_split=meta_split,
transform=transform, class_augmentations=class_augmentations,
download=download)
def download(self):
if self._check_integrity():
return
super(FC100ClassDataset, self).download()
subfolder = os.path.join(self.root, self.subfolder)
.. [2] Krizhevsky A. (2009). Learning Multiple Layers of Features from Tiny
Images. (https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf)
"""
def __init__(self, root, num_classes_per_task=None, meta_train=False,
meta_val=False, meta_test=False, meta_split=None,
transform=None, target_transform=None, dataset_transform=None,
class_augmentations=None, download=False):
dataset = CIFARFSClassDataset(root, meta_train=meta_train,
meta_val=meta_val, meta_test=meta_test, meta_split=meta_split,
transform=transform, class_augmentations=class_augmentations,
download=download)
super(CIFARFS, self).__init__(dataset, num_classes_per_task,
target_transform=target_transform, dataset_transform=dataset_transform)
class CIFARFSClassDataset(CIFAR100ClassDataset):
subfolder = 'cifar-fs'
def __init__(self, root, meta_train=False, meta_val=False, meta_test=False,
meta_split=None, transform=None, class_augmentations=None,
download=False):
super(CIFARFSClassDataset, self).__init__(root, meta_train=meta_train,
meta_val=meta_val, meta_test=meta_test, meta_split=meta_split,
transform=transform, class_augmentations=class_augmentations,
download=download)
def download(self):
if self._check_integrity():
return
super(CIFARFSClassDataset, self).download()
subfolder = os.path.join(self.root, self.subfolder)
def __init__(self, root, meta_train=False, meta_val=False, meta_test=False,
meta_split=None, transform=None, class_augmentations=None,
download=False):
super(CIFAR100ClassDataset, self).__init__(meta_train=meta_train,
meta_val=meta_val, meta_test=meta_test, meta_split=meta_split,
class_augmentations=class_augmentations)
if self.subfolder is None:
raise ValueError()
self.root = os.path.join(os.path.expanduser(root), self.folder)
self.transform = transform
self.split_filename_labels = os.path.join(self.root, self.subfolder,
self.filename_labels.format(self.meta_split))
self._data = None
self._labels = None
if download:
self.download()