def forward(self, model, fc, x, target_x, ratio):
features = model(x)
y = fc(features)
self.estimator.update_CV(features.detach(), target_x)
isda_aug_y = self.isda_aug(fc, features, y, target_x, self.estimator.CoVariance.detach(), ratio)
loss = self.cross_entropy(isda_aug_y, target_x)
return loss, y
imagenet-ISDA:
def forward(self, model, x, target_x, ratio):
y, features = model(x, isda=True)
# y = fc(features)
self.estimator.update_CV(features.detach(), target_x)
isda_aug_y = self.isda_aug(model.module.fc, features, y, target_x, self.estimator.CoVariance.detach(), ratio)
loss = self.cross_entropy(isda_aug_y, target_x)
return loss, y
why there is difference?
To apply ISDA to other models, the final fully connected layer does not needs to be explicitly defined in imagenet? right?
It's a little bit like centerLoss needs to return x and feature, right?
cifar-ISDA:
imagenet-ISDA:
why there is difference? To apply ISDA to other models, the final fully connected layer does not needs to be explicitly defined in imagenet? right? It's a little bit like centerLoss needs to return x and feature, right?