File size: 1,811 Bytes
5fee096
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Data Module

## Related codes:

```
core/data/augments.py
core/data/dataloader.py
core/data/dataset.py
```

## Dataset file format

In `LibContinual`, the dataset used has a fixed format. We read the data according to the dataset format set by most continual learning settings, such as [CIFAR-10](https://pytorch.org/vision/stable/datasets.html) and [CIFAR-100](https://pytorch.org/vision/stable/datasets.html). So we only need to download the dataset from the network and decompress it to use. If you want to use a new dataset and its data format is different from the above datasets, you need to convert it to the same format yourself.

Like CIFAR-10, the file format of the dataset should be the same as the following example:

```
dataset_folder/
β”œβ”€β”€ train/
β”‚Β Β  β”œβ”€β”€ class_1/
β”‚Β Β  Β Β  β”œβ”€β”€ image_1.png
β”‚      β”œβ”€β”€ ...
β”‚Β Β  Β Β  └── image_5000.png
β”‚   β”œβ”€β”€ ...
β”‚Β Β  β”œβ”€β”€ class_10/
β”‚Β Β  Β Β  β”œβ”€β”€ image_1.png
β”‚      β”œβ”€β”€ ...
β”‚Β Β  Β Β  └── image_5000.png
β”œβ”€β”€ test/
β”‚Β Β  β”œβ”€β”€ class_1/
β”‚Β Β  Β Β  β”œβ”€β”€ image_1.png
β”‚      β”œβ”€β”€ ...
β”‚Β Β  Β Β  └── image_5000.png
β”‚   β”œβ”€β”€ ...
β”‚Β Β  β”œβ”€β”€ class_10/
β”‚Β Β  Β Β  β”œβ”€β”€ image_1.png
β”‚      β”œβ”€β”€ ...
β”‚Β Β  Β Β  └── image_5000.png
```

The training images and test images need to be placed in the `train` and `test` folders respectively, where all images of the same category are placed in folde with the same name as the category, such as `cat` , `dog`, etc.

## Configure Datasets

After downloading or organizing the dataset according to the above file format, simply modify the `data_root` field in the configuration file. Note that `LibeContinual` will print the dataset folder name as the dataset name on the log.