Repository navigation
Ensure things happen in consistent order - #151
Conversation
tbekolay
left a comment
There was a problem hiding this comment.
Looking good! Made some inline comments, and this needs a changelog.
It would also be nice if there was a test, but I have to admit I am struggling to think of a test that isn't trivial ... do you think this will end up getting tested in #70?
| """For receiving host->chip messages""" | ||
|
|
||
| def __init__(self, dimensions, size_out): | ||
| def __init__(self, dimensions, size_out, **kwargs): |
There was a problem hiding this comment.
I think **kwargs is confusing here; for me, I don't really remember what other parameters there are to Node. If I look it up and see size_in, I'll get a TypeError if I try to specify it. I think we should bite the bullet and expose label and seed (or just label if seeds are irrelevant here).
| class ChipReceiveNeurons(ChipReceiveNode): | ||
| """Passes spikes directly (no on-off neuron encoding)""" | ||
| def __init__(self, dimensions, neuron_type=None): | ||
| def __init__(self, dimensions, neuron_type=None, **kwargs): |
There was a problem hiding this comment.
Here also, explicitly include label and (perhaps) seed.
|
From the review: we should add a test that splits a model multiple times and ensures that their order in the split networks is the same. |
|
I will write this test. |
c7e42b6 to
d83169c
Compare
|
Ok, I've added a test. I've tested that it can distinguish between before this PR and after it. |
- Splitter preserves object order from original network. - Host/chip receivers are always called in same order. Also added optional labels to ChipReceiveNodes and their CxSpikeInputs.
a381cf7 to
cd3ba5a
Compare
drasmuss
left a comment
There was a problem hiding this comment.
Looks good to me, just waiting for tests to run then will merge.
This makes sure that seeds are always set the same as well. Right now, setting a seed on a network does not actually guarantee it will be the same from one run to the next, because the splitter dictionaries change the order that everything gets built in in a non-deterministic way.