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 bug with no inputs to a neuron #246

Merged
merged 2 commits into from Jan 20, 2020
Merged

Conversation

hunse
Copy link
Collaborator

@hunse hunse commented Aug 14, 2019

Some arrays have shape (1, 0) which gives them a length of 1, but no size.

Copy link
Member

@tbekolay tbekolay left a comment

Fix looked good, but wasn't tested. I added in the short example from #245 and also added a changelog entry. Will merge when CI finishes successfully.

Copy link
Member

@tbekolay tbekolay left a comment

Turns out that this change works fine on emulator, but fails on hardware with the following warning from NxSDK:

Connection error: invalid index

For some reason, rather than failing to build, NxSDK goes into some kind of loop where it will keep trying (unsuccessfully) to build the network.

I'm not really sure where to start debugging that, so I'm going to send the PR back to you @hunse.



@pytest.mark.skipif(nengo_transforms is None, reason="Requires new nengo.transforms")
def test_sparse_transforms(Simulator):
Copy link
Collaborator Author

@hunse hunse Nov 22, 2019

Choose a reason for hiding this comment

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

Maybe test_sparse_transform_empty_neuron or something like that, since we're specifically testing sparse transforms that have some neurons that get no inputs, not sparse transforms generally. Also, we should put this description in a little docstring.

@hunse
Copy link
Collaborator Author

@hunse hunse commented Nov 22, 2019

Sounds good. Thanks for the test!

hunse added a commit that referenced this issue Dec 13, 2019
These are synapses with `base == None` or no weights. Building them
not only uses extra resources, but can cause index errors in the
NxSDK axon compiler.

Fixes the "invalid index" error raised in #246.
@hunse hunse force-pushed the fix-sparse-transforms branch from b89f607 to 3ad3a3b Compare Dec 13, 2019
@hunse
Copy link
Collaborator Author

@hunse hunse commented Dec 13, 2019

Ok, I think I've fixed the issue. 🤞 The solution was to not build synapses that have no weights, which is something that I meant to do at some point anyway. I had to rebase onto #261, so this will have to wait a bit until that's merged first.

@hunse
Copy link
Collaborator Author

@hunse hunse commented Dec 13, 2019

Also, I've got this as two commits right now, but I'd be fine squashing them (maybe to something like "Fix sparse connections with no inputs to some neurons").

hunse added 2 commits Jan 20, 2020
These are synapses with `base == None` or no weights. Building them
not only uses extra resources, but can cause index errors in the
NxSDK axon compiler.

Fixes the "invalid index" error raised in #246.
@tbekolay tbekolay changed the base branch from master to dummy-axon-host-snips Jan 20, 2020
@tbekolay tbekolay merged commit 779d445 into dummy-axon-host-snips Jan 20, 2020
1 of 3 checks passed
@tbekolay tbekolay deleted the fix-sparse-transforms branch Jan 20, 2020
tbekolay pushed a commit that referenced this issue Jan 22, 2020
These are synapses with `base == None` or no weights. Building them
not only uses extra resources, but can cause index errors in the
NxSDK axon compiler.

Fixes the "invalid index" error raised in #246.
tbekolay pushed a commit that referenced this issue Jan 22, 2020
For population connections, these dummy axons were still having
an effect. The synapses associated with these axons cause index
errors in the NxSDK axon compiler, so those are removed as well.

Fixes the "invalid index" error raised in #246.
tbekolay pushed a commit that referenced this issue Jan 22, 2020
For population connections, these dummy axons were still having
an effect. The synapses associated with these axons cause index
errors in the NxSDK axon compiler, so those are removed as well.

This commit also clarifies axon indices versus IDs.

Fixes the "invalid index" error raised in #246.
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.

None yet

2 participants