Skip to content

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

@ado-ml

Description

@ado-ml

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions