Skip to content

Commit

Permalink
Merge pull request #17 from gauenk/patch-1
Browse files Browse the repository at this point in the history
Update simclr.py
  • Loading branch information
Spijkervet committed Aug 30, 2020
2 parents f75dc28 + 628b910 commit 148d598
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions modules/simclr.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ def __init__(self, args, encoder, n_features):
nn.Linear(self.n_features, args.projection_dim, bias=False),
)

def get_resnet(self, name):
resnets = {
"resnet18": torchvision.models.resnet18(),
"resnet50": torchvision.models.resnet50(),
}
if name not in resnets.keys():
raise KeyError(f"{name} is not a valid ResNet version")
return modify_resnet_model(
resnets[name], cifar_stem=self.args.dataset.startswith("CIFAR"), v1=True
)

def forward(self, x_i, x_j):
h_i = self.encoder(x_i)
h_j = self.encoder(x_j)
Expand Down

0 comments on commit 148d598

Please sign in to comment.