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 do you handle your losses different scales #4

Open
EtienneT opened this issue May 28, 2020 · 1 comment
Open

How do you handle your losses different scales #4

EtienneT opened this issue May 28, 2020 · 1 comment

Comments

@EtienneT
Copy link

Hi,

Thanks you for the very interesting library! Looking at the code I was wondering how you were balancing the different losses scales. The MSE loss is probably on a completely different scale than the cross-entropy loss. How do you make sure that the MSE loss does not dominate compared to your other losses?

I never actually implemented this myself, but I found two papers that implement custom loss weights. This enables you to have any number of losses each with different scales, but then each gets its own weight for the calculation of the total loss.

The paper in question are section 3 of Multi-Task Learning Using Uncertainty to Weigh Losses and then section 2 of Auxiliary Tasks in Multi-task Learning where some other authors refine the formula a bit more from the first paper.

@AlliedToasters
Copy link
Owner

Sorry for the late reply!

Currently, there is no logic within the library for weighting or re-scaling the loss for different output values - this is a really good point and an important feature to add! So far, I've found the implementation as-is works pretty well for purposes of feature extraction - it can be improved, though!

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