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

Would x.clamp(min=eps) of gem() loss some information ? #73

Open
ado-ml opened this issue Aug 25, 2021 · 0 comments
Open

Would x.clamp(min=eps) of gem() loss some information ? #73

ado-ml opened this issue Aug 25, 2021 · 0 comments

Comments

@ado-ml
Copy link

ado-ml commented Aug 25, 2021

Hi Sir,

I noticed when implementing GeM pooling, there is a x.clamp(min=eps) inside, suppose in my feature x there are many value are less than this eps(say 1e-6) value, especially negative values, would this clamp operation cut off all the useful information, thus affect the performance? Thanks.

def gem(x, p=3, eps=1e-6):
    return F.avg_pool2d(x.clamp(min=eps).pow(p), (x.size(-2), x.size(-1))).pow(1./p)

BR
Chen Hao

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

1 participant