Skip last 1by1 layer and residual connection #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This saves between 0.5 and 1% of cpu (relative to without this change). In my own implementation I have it as a template parameter [1][2]. But I wasn't sure how to add it to yours. I guess the 20 comparisons (one for each layer) might pale in comparison to the matrix multiplication and addition that is saved. But possibly making it a template parameter might save another small fraction of a percent :)
[1] https://github.com/fps/anna/blob/master/examples/nam_wavenet.cpp
[2] https://github.com/fps/anna/blob/master/include/anna/nam.hpp