criterion.update now called in before_training_exp
@@ -105,10 +105,6 @@ class OnlineER_ACE(OnlineSupervisedTemplate):
self.replay_loader = None
self.ace_criterion = ACECriterion()
- def _before_training_iteration(self, **kwargs):
- self.ace_criterion.update(self.mb_y)
- super()._before_training_iteration(**kwargs)
-
def training_epoch(self, **kwargs):
"""Training epoch.
@@ -168,7 +164,7 @@ class OnlineER_ACE(OnlineSupervisedTemplate):
def _before_training_exp(self, **kwargs):
self.storage_policy.update(self, **kwargs)
-
+ self.ace_criterion.update(torch.tensor(self.experience.dataset.targets))
# Take all classes for ER ACE loss
buffer = self.storage_policy.buffer
if len(buffer) >= self.batch_size_mem:
@@ -259,10 +255,6 @@ class ER_ACE(SupervisedTemplate):
self.replay_loader = None
self.ace_criterion = ACECriterion()
- def _before_training_iteration(self, **kwargs):
- self.ace_criterion.update(self.mb_y)
- super()._before_training_iteration(**kwargs)
-
def training_epoch(self, **kwargs):
"""Training epoch.
@@ -323,6 +315,7 @@ class ER_ACE(SupervisedTemplate):
def _before_training_exp(self, **kwargs):
# Update buffer before training exp so that we have current data in
self.storage_policy.update(self, **kwargs)
+ self.ace_criterion.update(torch.tensor(self.experience.dataset.targets))
buffer = self.storage_policy.buffer
if len(buffer) >= self.batch_size_mem:
self.replay_loader = cycle(
