-
Notifications
You must be signed in to change notification settings - Fork 967
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
SpatialAveragePooling supports padding, ceil mode and more #365
Conversation
name |
this looks pretty good! squash and ready to push? |
Just squashed the commits. Is everyone ok with the namings for the new methods ? |
naming looks okay. will wait for sergey to make the cunn changes. |
This PR is useful, eg it's a prerequisite for neural-style to work on OpenCL/clnn in certain configurations. |
Hey! 2016 is nearly upon us ;-) Anything outstanding that needs to be addressed prior to merging this? |
I think we have addressed all the remaining problems with the Cuda version, but I haven't written all the unit tests for it. I'll finish the Cuda PR tomorrow. |
Cool. Thank you Francisco :-) |
|
||
By default, the output of each pooling region is divided by the fixed value | ||
`kW*kH`. If using padding or `ceil` mode, the number of elements in a region | ||
can be smaller than `kW*kW`. To switch between different division factors, |
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.
kW*kW
should be kW*kH
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.
Thanks for pointing out this typo. I'm fixing it.
Also, I should probably slightly reformulate this part of the documentation as well, because now I don't divide by the fixed value kW*kH
all the time. Indeed, for some degenerate cases (where the end position of the pooling region is outside the padded image), I only count the number of elements inside the padded image, which can be smaller than kW*kH
@fmassa whenever you have time, can you bring this to a conclusion. No real hurry, but def would like to see this and it's CUDA version in. |
@soumith The only thing missing is that it gives different results with respect to |
@fmassa : If I understand correctly, the issue is that the behavior doesnt quite match the cudnn behavior, and you dont want people to start using it, and then it becomes hard to fix the behavior later? So, can we do one or more of the following options?
(maybe just the first option, on its own, is sufficient?) |
@soumith I just passed again through both PRs and I think this one is good. The |
can you squash the commits, this is good to go. will merge asap. |
…ision Generalizes SpatialAveragePooling. When using padding or ceil mode, the number of elements in a region might be different from . The method considers only the number of elements in the pooling region for the averaging, whereas always divides by .
@soumith just squashed the commits. |
SpatialAveragePooling supports padding, ceil mode and more
Thanks. now @szagoruyko has to finish his asap. |
Cooooll.... :-) Just in time for Christmas :-D |
(cuda version ported/merged into clnn |
Generalizes
SpatialAveragePooling
to support free zero padding and ceil mode.When using padding or ceil mode, the effective number of elements in a region might be different from
kW*kH
. The:count_exclude_padding()
method considers only the number of elements in the pooling region for the averaging, whereas:count_include_padding()
always divides bykW*kH
.@szagoruyko has a cuda version of this PR.