From 31cbf981a17c636166dfdbd01286b95e473d86d1 Mon Sep 17 00:00:00 2001 From: Fabio Cermelli Date: Sun, 5 Dec 2021 18:03:33 +0100 Subject: [PATCH] Fix reformat Fixed self.pixel which should have been removed. --- methods/imprinting.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/methods/imprinting.py b/methods/imprinting.py index 62fe36f..eac8af3 100644 --- a/methods/imprinting.py +++ b/methods/imprinting.py @@ -105,15 +105,7 @@ def warm_up_(self, dataset, epochs=5): oi = oi[1:].softmax(dim=0) # make softmax on base classes / bkg -> C_b x P_c oi_acc[c - old_classes] += oi.mean(dim=1) - if self.pixel: - feat = F.normalize(feat, dim=0).t() - p = model.cls.cls[0].weight[0].view(1, 256).detach() - # p = p / p.norm() - bkg_score = -(feat * p).sum(dim=1) - max_score, max_idx = bkg_score.max(dim=0) - feat = feat[max_idx] - else: - feat = F.normalize(F.normalize(feat, dim=0).sum(dim=1), dim=0) + feat = F.normalize(F.normalize(feat, dim=0).sum(dim=1), dim=0) sum_features[c - old_classes] += feat count[c - old_classes] += 1