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

Implementation of Asymmetric Clipping #10

Closed
SiyaoNickHu opened this issue Oct 13, 2020 · 2 comments
Closed

Implementation of Asymmetric Clipping #10

SiyaoNickHu opened this issue Oct 13, 2020 · 2 comments

Comments

@SiyaoNickHu
Copy link

SiyaoNickHu commented Oct 13, 2020

Thanks for such an interesting paper 👍

In the paper's equation (4), asymmetric probability shifting is p_m = max(p-m, 0), but in the implementation, it's called asymmetric clipping and there is xs_neg = (xs_neg + self.clip).clamp(max=1) which is probably p_m = min(p+m, 1).

Is there a reason for this difference?

@mrT23
Copy link
Contributor

mrT23 commented Oct 14, 2020

Notice the definition in the code:

        self.xs_pos = torch.sigmoid(logits)
        self.xs_neg = 1.0 - self.xs_pos

so basically:
xs_pos=p
xs_neg=1-p

this is done to prevent calculating again and again (1-p) along the code...

@SiyaoNickHu
Copy link
Author

Oh I see. Nice trick!

Thanks for the quick response. I'll close the issue now.

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

2 participants