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

Update connections to work with new Transform API #142

Merged
merged 4 commits into from Feb 20, 2019

Conversation

Projects
None yet
2 participants
@drasmuss
Copy link
Contributor

drasmuss commented Nov 19, 2018

This gets all the tests passing with nengo master. Note that this does not support the new Convolution transforms, it just brings the existing nengo-loihi functionality up-to-date with nengo core. There are still several open PRs related to the nengo-loihi convolution implementation, so I figured I would wait for those to be resolved before trying to apply those changes.

Also note that right now I've done this in a non-backwards-compatible way (i.e. it does not work with nengo 2.8.0). Since nengo-loihi is pretty "in development", requiring the most up-to-date version of Nengo (assuming there is a new nengo release before the next nengo-loihi release) seems reasonable. But we could make it backwards compatible, it just adds a little extra complexity and maintenance burden.

TODO:

  • improve test coverage
  • update conv example notebook
Show resolved Hide resolved nengo_loihi/splitter.py Outdated
Show resolved Hide resolved nengo_loihi/builder.py Outdated
Show resolved Hide resolved nengo_loihi/builder.py Outdated
Show resolved Hide resolved nengo_loihi/builder.py Outdated
@drasmuss

This comment has been minimized.

Copy link
Contributor Author

drasmuss commented Dec 28, 2018

Rebased this to master, and added support for nengo.Convolution transforms. All the tests are passing, but I'm not confident that that means things are working, as the test coverage is a bit sparse. For example, it looks like a lot of the tests were set up as if they should test different conditions, but then those conditions aren't being tested (e.g. e39c54b#diff-2b5472730de7e72d3c4c167f986643d2R46, e39c54b#diff-2b5472730de7e72d3c4c167f986643d2R285, e39c54b#diff-2b5472730de7e72d3c4c167f986643d2R359, e39c54b#diff-2b5472730de7e72d3c4c167f986643d2R397). But I'm not sure if those un-tested conditions are expected to be working or not. So need @hunse to look it over, since he is most familiar with the convolution code (and might have other examples that could be made into tests).

Show resolved Hide resolved nengo_loihi/conv.py Outdated
Show resolved Hide resolved nengo_loihi/conv.py

@hunse hunse force-pushed the nengo-update branch from 078b018 to ce428e2 Feb 1, 2019

@hunse hunse referenced this pull request Feb 1, 2019

Merged

Seeds match Nengo #70

@hunse

This comment has been minimized.

Copy link
Contributor

hunse commented Feb 1, 2019

  • The xfail tests in test_conv.py should all work on the emulator, and currently they're not. I think it's just syntax changes related to this PR that were never fixed. So a reminder to do that before we merge.

@hunse hunse self-assigned this Feb 1, 2019

@hunse hunse force-pushed the nengo-update branch from ce428e2 to e0b3f66 Feb 1, 2019

@drasmuss drasmuss force-pushed the nengo-update branch 2 times, most recently from 72afaa7 to 28adc10 Feb 8, 2019

@drasmuss drasmuss force-pushed the nengo-update branch from b76333f to e267b8e Feb 19, 2019

Show resolved Hide resolved .travis.yml
" layer, conv = conv_layer(layer, 6, conv.output_shape, strides=2)\n",
" layer, conv = conv_layer(layer, 24, conv.output_shape, strides=2)\n",
" layer, conv = conv_layer(layer, 6, conv.output_shape, \n",
" strides=(2, 2))\n",

This comment has been minimized.

@hunse

hunse Feb 19, 2019

Contributor

It'd be nice to be able to pass an int and have it broadcast like before, since in my experience almost all the time you want the same strides in both directions. I realize that a) this would be a Nengo change and b) it would make it different than kernel_size which needs a tuple (since that specifies the number of dimensions for the convolution). I just wanted to raise the point here.

Show resolved Hide resolved nengo_loihi/builder/connection.py
Show resolved Hide resolved nengo_loihi/compat.py

@hunse hunse force-pushed the nengo-update branch from 5c48627 to 97777a4 Feb 20, 2019

@drasmuss drasmuss force-pushed the nengo-update branch from ca5456f to b9f3088 Feb 20, 2019

@hunse hunse force-pushed the nengo-update branch from b9f3088 to 0d6928e Feb 20, 2019

@hunse

hunse approved these changes Feb 20, 2019

Update connections to work with new Transform API
Also fix the passthrough logic for non-array transforms.

This is backwards compatibile with Nengo 2.8 transforms,
where we did not have Transform types (all transforms were arrays).

@hunse hunse force-pushed the nengo-update branch 2 times, most recently from 0271a86 to 803dded Feb 20, 2019

drasmuss added some commits Dec 28, 2018

Add support for Nengo convolution transforms
And update the MNIST example with new syntax and parameter files.

This is not backwards compatible: We do not support the new
convolution code with older Nengo, since much of the supporting code
is in new Nengo. However, this is not a significant regression,
since convolution only worked briefly with old Nengo.
Add nengo dev version builds to travis-ci
Also separate builds into basic and advanced stages.

This also makes test_learning.test_multiple_pes more robust;
lenthening the runtime seems to make it fail much less often.

@hunse hunse force-pushed the nengo-update branch from 803dded to 7176179 Feb 20, 2019

@hunse hunse merged commit 7176179 into master Feb 20, 2019

1 of 2 checks passed

codecov/patch 99.39% of diff hit (target 100%)
Details
codecov/project 95.67% (+1.09%) compared to fe343ec
Details

@hunse hunse deleted the nengo-update branch Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.