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

Update pooling.py #40841

Merged
merged 2 commits into from Nov 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions tensorflow/python/keras/layers/pooling.py
Expand Up @@ -338,10 +338,11 @@ class MaxPooling2D(Pooling2D):
window defined by `pool_size` for each dimension along the features axis.
The window is shifted by `strides` in each dimension. The resulting output
when using "valid" padding option has a shape(number of rows or columns) of:
`output_shape = (input_shape - pool_size + 1) / strides)`
`output_shape = math.floor((input_shape - pool_size) / strides) + 1`
(when input_shape >= pool_size)

The resulting output shape when using the "same" padding option is:
`output_shape = input_shape / strides`
`output_shape = math.floor((input_shape - 1) / strides) + 1`

For example, for stride=(1,1) and padding="valid":

Expand Down