avalanche.benchmarks.classic.CORe50

avalanche.benchmarks.classic.CORe50(*, scenario: str = 'nicv2_391', run: int = 0, object_lvl: bool = True, mini: bool = False, train_transform: typing.Optional[typing.Any] = Compose(     ToTensor()     RandomHorizontalFlip(p=0.5)     Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) ), eval_transform: typing.Optional[typing.Any] = Compose(     ToTensor()     Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) ), dataset_root: typing.Optional[typing.Union[str, pathlib.Path]] = None)[source]

Creates a CL benchmark for CORe50.

If the dataset is not present in the computer, this method will automatically download and store it.

This generator can be used to obtain the NI, NC, NIC and NICv2-* scenarios.

The benchmark instance returned by this method will have two fields, train_stream and test_stream, which can be iterated to obtain training and test Experience. Each Experience contains the dataset and the associated task label.

The task label “0” will be assigned to each experience.

The benchmark API is quite simple and is uniform across all benchmark generators. It is recommended to check the tutorial of the “benchmark” API, which contains usage examples ranging from “basic” to “advanced”.

Parameters
  • scenario – CORe50 main scenario. It can be chosen between ‘ni’, ‘nc’, ‘nic’, ‘nicv2_79’, ‘nicv2_196’ or ‘nicv2_391.’

  • run – number of run for the benchmark. Each run defines a different ordering. Must be a number between 0 and 9.

  • object_lvl – True for a 50-way classification at the object level. False if you want to use the categories as classes. Default to True.

  • mini – True for processing reduced 32x32 images instead of the original 128x128. Default to False.

  • train_transform – The transformation to apply to the training data, e.g. a random crop, a normalization or a concatenation of different transformations (see torchvision.transform documentation for a comprehensive list of possible transformations). Defaults to None.

  • eval_transform – The transformation to apply to the test data, e.g. a random crop, a normalization or a concatenation of different transformations (see torchvision.transform documentation for a comprehensive list of possible transformations). Defaults to None.

  • dataset_root – Absolute path indicating where to store the dataset and related metadata. Defaults to None, which means that the default location for ‘core50’ will be used.

Returns

a properly initialized GenericCLScenario instance.