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

How to set the beta? #6

Closed
kojingying opened this issue Jan 22, 2022 · 3 comments
Closed

How to set the beta? #6

kojingying opened this issue Jan 22, 2022 · 3 comments

Comments

@kojingying
Copy link

Hi, thanks for your nice work! However, I am confusing on how to set the beta

image
image

@alexandrosstergiou
Copy link
Owner

Hi @kojingying,

Your beta definition seems correct. You may want to ensure that the pooled x tensor will indeed be of oH,oW size.

For example, you can test if AdaPool2d works with beta=(1,1) (broadcasting the same value over the entire tensor as in issue #5 ).

Afterwards, if you would prefer to use beta as a matrix, you can find any difference between oH,oW and x.shape[2:].

@Culturenotes
Copy link

self.pool = nn.AvgPool2d(ih // 32, 1)<——self.pool = AdaPool2d(kernel_size=ih // 32, stride=1, beta=(1, 1))

When I try to replace avgpool2d with adapool2d, the following error occurs:

“AssertionError: Only CUDA implementation supported!”

How can I use it correctly?

@alexandrosstergiou
Copy link
Owner

@Culturenotes it seems that either your input tensor or the beta is in the CPU. The current implementation only runs in CUDA, so you'll need to have all tensors used in AdaPool2d in CUDA.

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