arthurdouillard / incremental_learning.pytorch

A collection of incremental learning paper implementations including PODNet (ECCV20) and Ghost (CVPR-W21).
MIT License
383 stars 60 forks source link

Bug? in the icarl model #61

Open BinahHu opened 2 years ago

BinahHu commented 2 years ago

https://github.com/arthurdouillard/incremental_learning.pytorch/blob/0d25c2e12bde4a4a25f81d5e316751c90e6f789b/inclearn/models/icarl.py#L446

The icarl model is appending the selected indexes for current task to the herding_indexes list, every time when the build_examplars() function is called.

This is fine if in each task build_examplars() is called just once, or when self._eval_every_x_epochs is 0. But when self._eval_every_x_epochs >0, build_examplars() is called for multiple times. The herding_indexes list is not storing correct indexes.

For example in task 1 we have 10 classes and we call build_examplars() for 2 times. The length of herding_indexes is 20. In task 2, we are using herding_indexes[10] to herding_indexes[19] to select examples for classes in task 2. While these indexes are calculated with the features of task 1!