Skip to content

Commit

Permalink
Remove unnecesasry code from simclr_like.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Böhm committed Dec 15, 2024
1 parent f082dab commit d96702d
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions tsimcne/models/simclr_like.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import torch.nn.functional as F
import torchvision

from ..base import ProjectBase


def make_model(
backbone,
Expand Down Expand Up @@ -83,26 +81,6 @@ def make_projection_head(name="mlp", in_dim=512, hidden_dim=1024, out_dim=128):
)


class SimCLRModel(ProjectBase):
def __init__(self, path, random_state=None, **kwargs):
super().__init__(path, random_state=random_state)
self.kwargs = kwargs

def get_deps(self):
return []

def load(self):
pass

def compute(self):
self.torch_seed = self.random_state.integers(2**64 - 1, dtype="uint")
self.model = make_model(**self.kwargs, seed=self.torch_seed)

def save(self):
save_data = dict(model=self.model, model_sd=self.model.state_dict())
self.save_lambda_alt(self.outdir / "model.pt", save_data, torch.save)


class ContrastiveFC(nn.Module):
def __init__(
self,
Expand Down

0 comments on commit d96702d

Please sign in to comment.