models
models copied to clipboard
Added a flag to allow skipping the first projection in small ResNets
Description
:memo: Please include a summary of the change.
- Please also include relevant motivation and context.
- List any dependencies that are required for this change.
This should fix https://github.com/tensorflow/models/issues/10583 In this issue, I described how the small ResNets implemented here have an extra convolution (for projection), that is neither present in the original paper or in PyTorch. This PR allows to get rid of this extra convolution with a keyword argument that defaults to the previous behaviour so that this remains a non-breaking change.
Type of change
For a new feature or function, please create an issue first to discuss it with us before submitting a pull request.
Note: I didn't wait for a discussion because this seemed like a relatively small and simple change, so it's not bothering for me to have written it even if rejected in the end.
- [x] New feature (non-breaking change which adds functionality)
Tests
:memo: Please describe the tests that you ran to verify your changes.
- Provide instructions so we can reproduce.
- Please also list any relevant details for your test configuration.
Test Configuration:
I added tests to check the parameter count. I also offline checked the number of non-trainable parameters to checked that it matched against PyTorch's one.
Checklist
- [x] I have signed the Contributor License Agreement.
- [x] I have read guidelines for pull request.
- [x] My code follows the coding guidelines.
- [x] I have performed a self code review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have made corresponding changes to the documentation.
- [x] My changes generate no new warnings.
- [x] I have added tests that prove my fix is effective or that my feature works.
There is a failure detected by internal tests. I think we forgot to update configs. @ByzanTine
@saberkun , indeed I had not updated the get_config method: just changed that.