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

Improve saving and loading of models #69

Merged
merged 38 commits into from
Oct 2, 2023

Conversation

gonlairo
Copy link
Contributor

@gonlairo gonlairo commented Sep 13, 2023

Improve model saving in the sklearn API to ensure future compatibility and safety. Currently, we save the entire object using torch.save, which may cause issues with different CEBRA versions. This pull request (PR) tackles this problem by suggesting a solution that involves saving only the model weights and all the arguments used, allowing for complete reconstruction of the CEBRA object at loading time.

Fix https://github.com/AdaptiveMotorControlLab/CEBRA-dev/pull/643
Fix #33
Fix https://github.com/AdaptiveMotorControlLab/CEBRA-dev/issues/623

@cla-bot cla-bot bot added the CLA signed label Sep 13, 2023
@stes stes changed the title Save models Improve saving and loading of models Sep 13, 2023
Copy link
Member

@stes stes left a comment

Choose a reason for hiding this comment

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

Some minor additions to the typing

cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
gonlairo and others added 4 commits September 13, 2023 23:13
Co-authored-by: Steffen Schneider <steffen@bethgelab.org>
Co-authored-by: Steffen Schneider <steffen@bethgelab.org>
Co-authored-by: Steffen Schneider <steffen@bethgelab.org>
Co-authored-by: Steffen Schneider <steffen@bethgelab.org>
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
cebra/integrations/sklearn/cebra.py Outdated Show resolved Hide resolved
tests/test_sklearn.py Outdated Show resolved Hide resolved
tests/test_sklearn.py Outdated Show resolved Hide resolved
tests/test_sklearn.py Outdated Show resolved Hide resolved
tests/test_sklearn.py Outdated Show resolved Hide resolved
This was referenced Sep 14, 2023
Copy link
Member

@stes stes left a comment

Choose a reason for hiding this comment

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

up to the remaining comment (whether to fix this as stable vs. still experimental), good to go.

- refine message on fxn
@MMathisLab MMathisLab merged commit eaa8940 into AdaptiveMotorControlLab:main Oct 2, 2023
9 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants