Conversation
Add pad_h, pad_w, kernel_size_h, kernel_size_w, stride_h, stride_w to support pooling on rectangle regions.
Replace pad_, kernel_size_, stride_ with pad_h_, pad_w_, kernel_size_h_, kernel_size_w_, stride_h_, stride_w_ to support pooling on rectangle regions.
Replace pad_, kernel_size_, stride_ with pad_h_, pad_w_, kernel_size_h_, kernel_size_w_, stride_h_, stride_w_ to support pooling on rectangle regions.
Replace pad_, kernel_size_, stride_ with pad_h_, pad_w_, kernel_size_h_, kernel_size_w_, stride_h_, stride_w_ to support pooling on rectangle regions.
There was a problem hiding this comment.
It seems that when kernel_size is specified, the other two are ignored. So why not both?
There was a problem hiding this comment.
For compatibility issue with previous caffe prototype file, we don't want to require users to update their network prototype. So, the user can either provide one parameter kernel_size or two parameters {kernel_size_w, kernel_size_h}. You may see #505 for detailed reasons.
|
Very useful generalization! Are you interested in further adding support for rectangular images? |
|
Rectangular pooling kernel regions have been added to TestCPUForwardMax, TestGPUForwardMax, TestCPUForwardMaxTopMask, TestGPUForwardMaxTopMask in test_pooling_layer.cpp |
|
Why are the first four commits repeated twice? The two commits with the message "fixing pooling SetUp() to allow default values for stride and pad" had better be squashed into one. |
|
@shelhamer @jeffdonahue would you have a look the changes and see if this PR can be merged? |
|
Hey @ronghanghu, this looks great! Please run |
|
style errors are fixed and gradient checks are added for non-square pooling. |
|
Perfect, thanks Ronghang. |
Rectangular pooling
Rectangular pooling
Implemented rectangular pooling, allowing pooling with different kernel_size, stride and pad along each axis.
Tests on rectangular pooling kernel regions have been added.