Skip to content

Commit

Permalink
fix imagenet-100 and orthognality metric bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yifei Wang committed Apr 5, 2024
1 parent 0554940 commit cf6a837
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/pretrain/imagenet-100/ncl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hydra:
run:
dir: .

name: "simclr-imagenet100"
name: "simclr-imagenet100-ncl"
method: "simclr"
backbone:
name: "resnet18"
Expand All @@ -24,7 +24,7 @@ method_kwargs:
learn_temp: 0
normalize: dim
tau: 1
non_neg: non_neg
non_neg: relu
data:
dataset: imagenet100
train_path: "imagenet100/train"
Expand Down
2 changes: 1 addition & 1 deletion scripts/pretrain/imagenet-100/simclr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ method_kwargs:
learn_temp: 0
normalize: dim
tau: 1
non_neg: none
non_neg: None
data:
dataset: imagenet100
train_path: "imagenet100/train"
Expand Down
2 changes: 1 addition & 1 deletion scripts/pretrain/imagenet-100/wandb/private.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
enabled: True
entity: null
project: "solo-nmf"
project: "non_neg"
2 changes: 1 addition & 1 deletion solo/methods/simclr.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def semantic_consistency(features, labels, eps=1e-5, take_abs=False, topk=False)
logger("semantic_consistency", semantic_consistency(z, targets), on_epoch=True, sync_dist=True)

def orthogonality(features, eps=1e-5):
features = features[:,features.sum(0)>10]
features = features[:,features.abs().sum(0)>0]
n, d = features.shape
features = F.normalize(features, dim=0)
corr = features.T @ features
Expand Down

0 comments on commit cf6a837

Please sign in to comment.