2
$\begingroup$

I am training a neural network for multiclass classification.

I want to combine a custom loss function with another more generic loss. I've been simply adding it, and it works quite well but towards the end the though the custom loss is weighted more heavily because it has a bigger magnitude.

I've done something like loss1(loss2/thresh) where thresh is just the threshold I want loss2 to be less than. Which was worse than just adding it.

It's suboptimal and was hoping someone here might point me in a better direction.

Best Regards,

Oliver

$\endgroup$

1 Answer 1

1
$\begingroup$

The usual course of action is having a parameter $\lambda$ to balance the losses, e.g. $L=L_1+\lambda L_2$, and treat $\lambda$ as a hyper-parameter. They won't be always equally balanced, but this way, you can choose the importance you want to give to each loss.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.