Skip to content

Commit

Permalink
Remove loss_name value and save loss adaptively
Browse files Browse the repository at this point in the history
Save it if it is a string, otherwise ignore
  • Loading branch information
Niklas Böhm committed Jan 10, 2025
1 parent ba6fdc0 commit 4a8f043
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tsimcne/tsimcne.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __init__(
self,
model=None,
loss="infonce",
loss_name=None,
metric=None,
temperature=0.5,
backbone="resnet18_sm_kernel",
Expand All @@ -63,16 +62,15 @@ def __init__(
):
super().__init__()
ignore_list = [
"loss",
"backbone",
"projection_head",
"eval_function",
"model",
]
ignore_list += ["loss"] if not isinstance(loss, str) else []
self.save_hyperparameters(ignore=ignore_list)
self.model = model
self.loss = loss
self.loss_name = self.loss if loss_name is None else loss_name
self.metric = metric
self.temperature = temperature
self.backbone = backbone
Expand Down

0 comments on commit 4a8f043

Please sign in to comment.