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.
A new layer that allows to run fully convolutional nets efficiently with a denser stride. It's best illustrated with an example: Take VGG net, which has a convolutional stride of 16 (without the last pooling). There is currently no good way of running running the net at a denser stride (let say 4).
The easiest solution would be to just reduce the stride of the pooling (eg. from 2 to 1). This unfortunately only works if there is no other layer following the pooling. In all other cases it will mess up the order of the data.
The repack layer addresses this ordering issue. It reorganizes the data (eg. multiple shifted versions of an image) and packs them along the 'num' dimension in a blob.
After all convolutions are done the data can then simply be unpacked into a complete image again.
Here is a small example on VGG: Let's say we want to decrease the stride from 16 to 8. We simply replace the bottom most pooling of stride 2 with a stride 1 pooling followed by repacking:
gets replaced by
The will produce an output that contains four images stacked along the 'num' direction. To unpack the stack simply add another repack layer to the end of the network
The repacking trick allows us to evaluate VGG with a stride of 4 instead of 16 (16 times the samples) in roughly 3 times the runtime.