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

Convolution transpose #183

Merged
merged 2 commits into from
Dec 8, 2021
Merged

Convolution transpose #183

merged 2 commits into from
Dec 8, 2021

Conversation

hunse
Copy link
Collaborator

@hunse hunse commented Oct 19, 2020

Support the ConvTransposeInc operator added in nengo/nengo#1648.

Things might be a bit cleaner if we support GeneralConvInc instead of ConvInc and ConvTransposeInc (then e.g. we could have one GeneralConvSet operator), but some code (e.g. operator merging) breaks if we don't have build methods for each operator class (if we try to do them only for a superclass).

TODO:

  • Test merging ConvTransposeInc

@hunse hunse force-pushed the convolution-transpose branch 3 times, most recently from 6bfaa07 to 69e34ef Compare October 20, 2020 13:43
@tbekolay tbekolay force-pushed the convolution-transpose branch 2 times, most recently from fbb5270 to d338d0b Compare December 3, 2021 21:40
Copy link
Member

@tbekolay tbekolay left a comment

Choose a reason for hiding this comment

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

This LGTM and the tests pass, but as with a lot of NengoDL stuff, I don't know this material deep enough to comment on things like efficiency and correctness. Do you want to take a quick look as well @drasmuss?

Copy link
Member

@drasmuss drasmuss left a comment

Choose a reason for hiding this comment

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

Took a look through, some minor comments on efficiency/version handling below but all looks good other than that 👍

nengo_dl/tests/test_graph_optimizer.py Outdated Show resolved Hide resolved
nengo_dl/compat.py Outdated Show resolved Hide resolved
nengo_dl/tests/test_transforms.py Outdated Show resolved Hide resolved
nengo_dl/tests/test_transforms.py Outdated Show resolved Hide resolved
nengo_dl/transform_builders.py Outdated Show resolved Hide resolved
nengo_dl/transform_builders.py Outdated Show resolved Hide resolved
@tbekolay
Copy link
Member

tbekolay commented Dec 6, 2021

OK, fixed those compat.py checks, and the new pylint warnings. I also looked into the other test failures and ended up being a NengoCore bug recently introduced. Fix that is here: nengo/nengo#1678 and those tests should pass once that's merged in.

Copy link
Member

@drasmuss drasmuss left a comment

Choose a reason for hiding this comment

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

Fixups LGTM 👍

7d0d54c - Upgrade black version to 21.12b0
378ad3d - Switch to new codecov uploader
ab7f940 - Avoid bad astroid version
@tbekolay tbekolay force-pushed the convolution-transpose branch 2 times, most recently from 029d4fa to 84e8dfa Compare December 8, 2021 15:27
@tbekolay
Copy link
Member

tbekolay commented Dec 8, 2021

Ok, pushed again, d8619d3 is the original version of the PR and 84e8dfa is my fixup with the batch_size change. You can inspect X right before the tf.nn.conv_transpose call to see what's up with that.

@tbekolay
Copy link
Member

tbekolay commented Dec 8, 2021

Squashed it all, and added one change. We moved those tests to a new file, so that custom allclose tolerance had to move, but also I found that I had to increase the tolerance a fair bit. This might be due to all the transposing exacerbating floating point rounding differences (though that doesn't sound plausible when I type it out), or simply the seed changed and this new seed is unlucky. Here's the failure that I was getting:

>       assert allclose(sim.data[p][0], np.ravel(truth))
E       assert False
E        +      where <function ravel at 0x7f18d0880430> = np.ravel

../nengo/nengo/tests/test_transforms_conv.py:151: AssertionError
---------------------------------- Captured stdout call ----------------------------------
allclose first 1 failures:
  (144,): 0.3311653 0.331148611031138
================== relative root mean squared error for allclose checks ==================
mean relative RMSE: 0.00000 +/- 0.0000 (std)

So it's a negligible difference in one array element. Probably just unlucky!

@tbekolay tbekolay merged commit 511aa4e into master Dec 8, 2021
@tbekolay tbekolay deleted the convolution-transpose branch December 8, 2021 18:54
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.

3 participants