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

Support Sparse transforms in Simulator.get_nengo_params #149

Merged
merged 4 commits into from
Apr 13, 2020
Merged

Conversation

drasmuss
Copy link
Member

@drasmuss drasmuss commented Apr 9, 2020

This functionality (and Simulator.freeze_params, which depends on it) had not been updated after the introduction of Sparse transforms.

Fixes #148

nengo_dl/compat.py Show resolved Hide resolved
nengo_dl/compat.py Outdated Show resolved Hide resolved

with Simulator(net) as sim0:
params = sim0.get_nengo_params(conn)
assert np.allclose(params["transform"].init.data, data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this work if Scipy is not installed? In that case, what will params["transform"].init be? I'm assuming a Numpy array, but right now when I try without Scipy I'm getting Aborted (core dumped). I'll look into it a bit more. Is this expected to work without Scipy, or does NengoDL only support sparse with Scipy (in which case, we should mark this whole test as requiring Scipy)?

Copy link
Member Author

Choose a reason for hiding this comment

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

This test should be skipped if scipy isn't installed (in the use_scipy=True condition). In the use_scipy=False condition, .init.data will be SparseMatrix.data.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I forgot we had the SparseMatrix. Anyway, I reinstalled and uninstalled Scipy and the weird error disappeared, so who knows? But it seems good now.

@hunse hunse merged commit ac6dbcd into master Apr 13, 2020
@hunse hunse deleted the conv-freeze branch April 13, 2020 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Freeze_params not working on connection to conv layer
2 participants