Difference in the way of copying the samples from task to buffer memory of GEM and A-GEM in update_memory function #1117
-
Hi avalanche team, While going through the implementation of GEM and A-GEM, I found the following differences in storing the samples from task to buffer memory. In GEM implementation (lines 127 to 158,https://github.com/ContinualAI/avalanche/blob/master/avalanche/training/plugins/gem.py), authors are copying from the first sample of the current task till the sample with index value equal to self.patterns_per_experience into the buffer memory. In other words, self.patterns_per_experience sized several samples from the first indexed sample of the current task are copied into the buffer memory. However, in A-GEM (line 128,https://github.com/ContinualAI/avalanche/blob/73210af748d5de74e1ae73c00f525454b4129cd2/avalanche/training/plugins/agem.py) current task samples are stored in the buffer memory using the random_split function. My question here is why there is a different strategy for GEM and A-GEM. Technically, A-GEM is an efficient variant of GEM in terms of the number of constraints in the objective function. Please let me know, If I miss anything |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If I remember correctly, GEM and A-GEM do not specify the buffer policy, so any reasonable policy should be ok. I don't think there is any specific reason why the two policies are different, we just implemented the algorithms in different moments. We could improve Avalanche implementation by making the buffer policy a parameter, so that users can change it. Of course if you need a specific policy it's easy to change the plugins to achieve what you want. |
Beta Was this translation helpful? Give feedback.
If I remember correctly, GEM and A-GEM do not specify the buffer policy, so any reasonable policy should be ok. I don't think there is any specific reason why the two policies are different, we just implemented the algorithms in different moments. We could improve Avalanche implementation by making the buffer policy a parameter, so that users can change it.
Of course if you need a specific policy it's easy to change the plugins to achieve what you want.