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

ohem_ratio #15

Open
ChenghaoMou opened this issue Sep 11, 2021 · 1 comment
Open

ohem_ratio #15

ChenghaoMou opened this issue Sep 11, 2021 · 1 comment

Comments

@ChenghaoMou
Copy link

In the code comment, ohem_ratio refers to the max ratio of positive/negative, defautls to 0.0, which means no ohem.

But later in the code, it is computing keep_num with a formula keep_num = min(int(pos_num * self.ohem_ratio / logits_size), neg_num).

Should the comment be changed to negative/positive?

@kamfonas
Copy link

I had the same question. I am looking at the provided example where ohem=0.1. I think if the intention were for ohem to be negative/positive then the example should probably use ohem = 10 instead. This makes me think that the intention is for ohem to be as specified in the comments: pos/neg, but the formula used should be changed to keep_num = min(int(pos_num / self.ohem_ratio / logits_size), neg_num)

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