Fix bug with no inputs to a neuron#246
Conversation
8592c3a to
366e650
Compare
366e650 to
b89f607
Compare
tbekolay
left a comment
There was a problem hiding this 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): |
There was a problem hiding this comment.
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.
|
Sounds good. Thanks for the test! |
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.
b89f607 to
3ad3a3b
Compare
|
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. |
|
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"). |
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.
41ef09f to
779d445
Compare
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.
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.
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.
Some arrays have shape
(1, 0)which gives them a length of 1, but no size.