Skip to content

Flops regularizer looks odd #41

Description

@dangkhoasdc

This implement does not look similar to the formula mentioned in SPLADE paper. Also, to minimize this, the 2nd operand need to be equal to threshold, which is not the goal of FLOPS.

input=torch.mean(input=torch.abs(input=activations), dim=0) ** 2, dim=0

There is another implementation more akin to the formula:

https://github.com/thongnt99/learned-sparse-retrieval/blob/d702026aacf1ab7c47011f55edcb2646a6bb646d/lsr/losses/regularizer.py#L56

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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