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

Fix description and formula in pooling operations #449

Closed
zolkis opened this issue Aug 15, 2023 · 3 comments
Closed

Fix description and formula in pooling operations #449

zolkis opened this issue Aug 15, 2023 · 3 comments

Comments

@zolkis
Copy link
Collaborator

zolkis commented Aug 15, 2023

Originally posted by @shiyi9801 in #446 (comment)

What is filter size in pooling operations, do you mean window_size?
Also this equation seems wrong. Referring to conv2d operation, I guess the correct equation looks like this?
output_size = ceil(1 + (input_size - (window_size - 1) * dilation - 1 + beginning_padding + ending_padding) / stride)
So as floor.
See the Returns section in https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-pool2d

@zolkis zolkis changed the title What is filter size in pooling operations, do you mean window_size? Fix description and formula in pooling operations Aug 15, 2023
@zolkis
Copy link
Collaborator Author

zolkis commented Aug 25, 2023

This seems not specific to #446, it's a separate problem.
We need to check the formula in the Returns section.
Then we can update the algorithm. Right now the algorithm uses generic formulation, leaving to the implementation how to calculate the output size.

@anssiko
Copy link
Member

anssiko commented Feb 1, 2024

This part of the Returns section:

More specifically, if the options.roundingType is "floor", the spatial dimensions of the output tensor can be calculated as follow:

output size = floor(1 + (input size - filter size + beginning padding + ending padding) / stride)

or if options.roundingType is "ceil":

output size = ceil(1 + (input size - filter size + beginning padding + ending padding) / stride)

... reads like informative text. It should be marked as such and the two formulas corrected.

@zolkis
Copy link
Collaborator Author

zolkis commented Mar 25, 2024

Fixed by #478

@zolkis zolkis closed this as completed Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants