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

Save/restore Workspace #201

Open
mbillingr opened this issue Oct 7, 2019 · 2 comments
Open

Save/restore Workspace #201

mbillingr opened this issue Oct 7, 2019 · 2 comments

Comments

@mbillingr
Copy link
Member

Certain computations such as MVARICA can take a lot of time but do not need to be performed very often because their results can be reused. It might be a useful feature for users of the high-level API to be able to dump and restore the entire Workspace.

I can see two possible implementation approaches:

  1. Find out why the Workspace class cannot be pickled and see if that's easy to fix. (I suspect the culprit is a lambda function stored somewhere...)
  2. Only save certain arrays from within the Workspace (mixing/unmixing matrices, VAR coefficients, activations, ...) and make the user responsible for setting up a Workspace with the correct configuration before loading.

Any thoughts? What are the use cases?

@cbrnr
Copy link
Contributor

cbrnr commented Oct 7, 2019

If I understand correctly, it might be useful to pre-compute connectivity features for the whole data set, which can then be used in cross-validating different classifiers. I wasn't aware that this isn't possible with the workspace - I now wonder if this can be implemented with the functional API?

Regarding the implementation, I'd prefer option 1. We had a similar issue in mne-tools/mne-python#6252, where we defined a custom __new__ method.

@mbillingr
Copy link
Member Author

I think there is no problem with the functional API because most functions return numpy arrays or collections of numpy arrays. These can be easily saved and loaded using numpy's save and load routines.

The Workspace is basically a class that manages intermediate results without exposing them to the user. To store the current Workspace state we would need to support pickle or expose a save/load API that internally handles the intermediate arrays. If possible I would prefer option 1, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants