Skip to content

Comments

Add parameter for pooling layer to specify "ceil" or "floor"#3057

Closed
dujianyi wants to merge 2 commits intoBVLC:masterfrom
dujianyi:master
Closed

Add parameter for pooling layer to specify "ceil" or "floor"#3057
dujianyi wants to merge 2 commits intoBVLC:masterfrom
dujianyi:master

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?

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.

9 participants