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

How to weight some examples if loss may be negative #38

Open
shkarupa-alex opened this issue Feb 11, 2022 · 1 comment
Open

How to weight some examples if loss may be negative #38

shkarupa-alex opened this issue Feb 11, 2022 · 1 comment

Comments

@shkarupa-alex
Copy link

In most cases when we have loss >= 0 with shape [batch_size] and we want to weight up importance of some examples we would multiply loss by weight. E.g. loss = [0.1, 0.3], weights = [2., 1.], weighted_loss = [0.2, 0.3]

But how should we do that for RMI loss that may be negative?
E.g. loss = [-0.1, -0.3], weights = [2., 1.], weighted_loss = [-0.2, -0.3]. In this example weighted loss will be smaller instead of expected "larger".

Should we multiply loss by weights or divide?

@mzhaoshuai
Copy link
Member

Well, I guess we can find a lower bound of RMI, eg., -1000, and plus the negative loss value with RMI, then achieve re-weighting.

Sorry for this late reply.
This repo is old and I am busy with other projects.
It will not be maintained in the future.

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