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

Fixing Bug with HPO #345

Merged
merged 22 commits into from
Jul 27, 2023
Merged

Fixing Bug with HPO #345

merged 22 commits into from
Jul 27, 2023

Conversation

wistuba
Copy link
Contributor

@wistuba wistuba commented Jul 21, 2023

Hyperparameter defined as part of the components were overwritten by values in state_dict. To address this issue, Component no longer is a nn.Module.

Moving from torch.tensor to Python floats had led to changes for CLS (and therefore Super-ER) at the 8th digit. These errors accumulate and therefore give some different numbers. To account for this, I've changed the expected values for CLS and Super-ER.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@wistuba wistuba marked this pull request as draft July 21, 2023 13:57
@wistuba wistuba marked this pull request as ready for review July 25, 2023 14:25
@github-actions
Copy link

github-actions bot commented Jul 25, 2023

Coverage report

The coverage rate went from 85.68% to 86.02% ⬆️

96.07% of new lines are covered.

Diff Coverage details (click to unfold)

src/renate/updaters/experimental/er.py

100% of new lines are covered (92.02% of the complete file).

src/renate/updaters/learner_components/reinitialization.py

100% of new lines are covered (95.65% of the complete file).

src/renate/updaters/learner_components/losses.py

92.59% of new lines are covered (62.01% of the complete file).
Missing lines: 154, 194

src/renate/updaters/learner_components/component.py

100% of new lines are covered (95.45% of the complete file).

def on_save_checkpoint(self, checkpoint: Dict[str, Any]) -> None:
"""Add plastic and stable model to checkpoint."""
super().on_save_checkpoint(checkpoint)
checkpoint["component-cls-plastic-model"] = self._plastic_model
Copy link
Contributor

Choose a reason for hiding this comment

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

We should save and load self._plastic_model.state_dict() instead of the model object itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -5,6 +5,6 @@
"dataset": "mnist.json",
"backend": "local",
"job_name": "class-incremental-mlp-cls-er",
"expected_accuracy_linux": [[0.9839243292808533, 0.9740450382232666]],
"expected_accuracy_linux": [[0.9834515452384949, 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.

Shouldn't the results remain unaffected by the changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See PR description for more details. In short, working with torch.tensor(1.0) and float(1.0) seem to cause differences.

@wistuba wistuba requested a review from lballes July 26, 2023 15:21
@lballes lballes merged commit 2e071d8 into dev Jul 27, 2023
18 checks passed
@lballes lballes deleted the mw-fix-component-loading branch July 27, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants