ContinualAI / avalanche

Avalanche: an End-to-End Library for Continual Learning based on PyTorch.
http://avalanche.continualai.org
MIT License
1.76k stars 289 forks source link

Support initialization of strategy plugins from precomputed state (e.g. Fisher Importances in EWC, Teacher in LwF) #1165

Open yonatansverdlov opened 1 year ago

yonatansverdlov commented 1 year ago

Hi There. If for example I have a pretrained model and I want to apply EWC plugin, and to begin training with its regulization I can't as its coefficients are not computed yet. I think that the feature of pretrained model is a must to have a fair baseline and to save computation.

AntonioCarta commented 1 year ago

We use EWC as described in the original paper. What you are proposing is a different method. You would have to modify the EWC plugin to do this. It should a simple modification since you can reuse the same importance computation, you just need to give it a dataset.

yonatansverdlov commented 1 year ago

Fully agree. I just thought about adding this feature to all similar plugins as it would be convenient for all users.

בתאריך יום ו׳, 28 באוק׳ 2022, 10:38, מאת Antonio Carta ‏< @.***>:

We use EWC as described in the original paper. What you are proposing is a different method. You would have to modify the EWC plugin to do this. It should be a simple modification since you can reuse the same importance computation, you just need to give it a dataset.

— Reply to this email directly, view it on GitHub https://github.com/ContinualAI/avalanche/issues/1165#issuecomment-1294600247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVTIJUD2OSPBQWLHHK6AMGTWFN7HHANCNFSM6AAAAAAROJNRXI . You are receiving this because you authored the thread.Message ID: @.***>

AntonioCarta commented 1 year ago

We are adding support for checkpointing and serialization of strategies, which should partially cover what you ask as long as you train your pretrained model with avalanche. As an alternative, we could also add support for initializing some plugins with some precomputed values (e.g. importances that you already have).

I will leave this open as a low priority feature request. For the moment, you can do it by yourself by subclassing the plugins.

AntonioCarta commented 1 year ago

Closing this since we now support checkpointing.