Skip to content

Commit

Permalink
Fix reformat
Browse files Browse the repository at this point in the history
Fixed self.pixel which should have been removed.
  • Loading branch information
fcdl94 authored Dec 5, 2021
1 parent 2987970 commit 31cbf98
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions methods/imprinting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 31cbf98

Please sign in to comment.