-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Add parameter for pooling layer to specify "ceil" or "floor" #3057
Conversation
It might be more intuitive/readable to have this be an enum with choices FLOOR and CEIL. |
See also #1318... |
@longjon Has that issue been solved? |
include/caffe/vision_layers.hpp
Outdated
@@ -416,6 +416,7 @@ class PoolingLayer : public Layer<Dtype> { | |||
int height_, width_; | |||
int pooled_height_, pooled_width_; | |||
bool global_pooling_; | |||
bool ceil_mode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool ceil_mode_;
working C++ code for floor and ceil can be found at https://www.tutorialcup.com/array/floor-ceil.htm |
how to modify the pooling_layer.cu ? |
Thank you. Can you also update pooling_layer.hpp? Currently the new variable ceil_mode_ is only added to vision_layers.hpp (not sure where this file will be used; apparently pooling_layer.hpp doesn't include it). |
@Noiredd in light of PR#6282, can we close this PR? |
ceil_mode was proposed in BVLC/caffe#3057 , but never merged. Its replacement, BVLC/caffe#6282 , fulfils the same need with some syntactic variance. The param is now called "round_mode" and it is an enum, instead of a boolean. This commit modifies the files accordingly.
When I am trying to convert
torch.nn
network to caffe, I met the problem that I can't specifyfloor
mode for MaxPooling to calculate the output size. Innn
, you can specify it freely between:ceil()
and:floor()
, so it could be better to include this parameter for users to choose.