Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CLS-ER Loss #347

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/renate/updaters/learner_components/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def _loss(
(inputs_memory, targets_memory), _ = batch_memory
with torch.no_grad():
outputs_plastic = self._plastic_model(inputs_memory)
outputs_stable = self._plastic_model(inputs_memory)
outputs_stable = self._stable_model(inputs_memory)
probs_plastic = F.softmax(outputs_plastic, dim=-1)
probs_stable = F.softmax(outputs_stable, dim=-1)
label_mask = F.one_hot(targets_memory, num_classes=outputs_stable.shape[-1]) > 0
Expand Down
4 changes: 2 additions & 2 deletions test/integration_tests/configs/suites/quick/cls-er.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"dataset": "mnist.json",
"backend": "local",
"job_name": "class-incremental-mlp-cls-er",
"expected_accuracy_linux": [[0.9858155846595764, 0.9740450382232666]],
"expected_accuracy_darwin": [[0.9858155846595764, 0.9755141735076904]]
"expected_accuracy_linux": [[0.9839243292808533, 0.9740450382232666]],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not result in changes at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently not

"expected_accuracy_darwin": [[0.9834515452384949, 0.9740450382232666]]
}
4 changes: 2 additions & 2 deletions test/integration_tests/configs/suites/quick/super-er.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"dataset": "fashionmnist.json",
"backend": "local",
"job_name": "class-incremental-mlp-super-er",
"expected_accuracy_linux": [[0.9330000281333923, 0.9144999980926514], [0.9434999823570251, 0.8974999785423279]],
"expected_accuracy_darwin": [[0.9390000104904175, 0.9089999794960022]]
"expected_accuracy_linux": [[0.9390000104904175, 0.9120000004768372], [0.9384999871253967, 0.9129999876022339]],
"expected_accuracy_darwin": [[0.9399999976158142, 0.9129999876022339]]
}