Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

dujianyi
Copy link

When I am trying to convert torch.nn network to caffe, I met the problem that I can't specify floor mode for MaxPooling to calculate the output size. In nn, you can specify it freely between :ceil() and :floor(), so it could be better to include this parameter for users to choose.

@seanbell
Copy link

It might be more intuitive/readable to have this be an enum with choices FLOOR and CEIL.

@longjon
Copy link
Contributor

longjon commented Sep 10, 2015

See also #1318...

@dujianyi
Copy link
Author

@longjon Has that issue been solved?

@@ -416,6 +416,7 @@ class PoolingLayer : public Layer<Dtype> {
int height_, width_;
int pooled_height_, pooled_width_;
bool global_pooling_;
bool ceil_mode;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool ceil_mode_;

@mazakaro
Copy link

working C++ code for floor and ceil can be found at https://www.tutorialcup.com/array/floor-ceil.htm

@kli-casia
Copy link
Contributor

how to modify the pooling_layer.cu ?

@askerlee
Copy link

askerlee commented Dec 1, 2017

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).

@shaibagon
Copy link
Member

@Noiredd in light of PR#6282, can we close this PR?

keerthanss added a commit to keerthanss/DenseNet-Caffe that referenced this pull request Feb 27, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants