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

Enhancement: 2d Pooling #1

Closed
torridgristle opened this issue Feb 1, 2022 · 6 comments
Closed

Enhancement: 2d Pooling #1

torridgristle opened this issue Feb 1, 2022 · 6 comments

Comments

@torridgristle
Copy link

Could put in 2d pooling for an easy to drop in alternative to AvgPool2d by using pixel_unshuffle for cases where there's exact divisions of an input shape, or padding and unfold for overlapping windows / strides that aren't equal to the window size.

I don't know how fast Unfold is or if there's a better way to do the operation; I tried checking the PyTorch github to see how it does AvgPool2d for strides that aren't equal to the window size behind the scenes but I can never seem to figure out which version of the operation is the one that's used, it's defined in so many places it's beyond me.

I've once seen an alternative to pixel unshuffle that used grouped conv2d, a kernel that put each position into its own channel output, and stride, but I can't seem to find it again. It was useful because you could adjust the stride and then it'd be like Unfold, but I never got around to testing if it was actually faster.

@lucidrains
Copy link
Owner

@torridgristle sure i'll think about it, perhaps can build it with https://github.com/openai/triton

@lucidrains
Copy link
Owner

@torridgristle would you be willing to share some of your experimental results, if i were to make the LogAvgExpPool2d?

@lucidrains
Copy link
Owner

@ekurtulus
Copy link

Thanks a lot @lucidrains, a great implementation. Will 3D variant be implemented as well ?

@lucidrains
Copy link
Owner

@ekurtulus 👋 sure, why not 250852d

@ekurtulus
Copy link

Thanks a lot : )

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

No branches or pull requests

3 participants