mmasana / FACIL

Framework for Analysis of Class-Incremental Learning with 12 state-of-the-art methods and 3 baselines.
https://arxiv.org/pdf/2010.15277.pdf
MIT License
512 stars 98 forks source link

Limit the number of images per class #31

Closed andreadaou closed 1 year ago

andreadaou commented 1 year ago

Hello,

Is there any argument in the code that let us limit the number of images per class (training images and test images)? For example, when adding a new dataset with .txt files, we need each time to modify these files to vary the number of images.

Thank you for your help !!

mmasana commented 1 year ago

Hi @andreadaou ,

currently there is no such argument to not over-complicate more the framework. However, you can easily define this on your main by reducing the loader size after creating the loaders. Iterate through them and do smth like:

trn_loader[t].dataset.images = trn_loader[t].dataset.images[:MAX_NUM]
trn_loader[t].dataset.labels = trn_loader[t].dataset.labels[:MAX_NUM]

It's not the most efficient or versatile, but it quickly solves the issue.

andreadaou commented 1 year ago

Thank you !