Custom module loss containing multiple losses #2007
Replies: 1 comment
-
I think this does the trick for now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I want to try Text Recognition with SVTR and CRNN with customized module loss. In detail, I am trying to apply custom regularization on CTC. So, the total loss for the model will be
total_loss = loss_ctc + regularization_weight * loss_regularization
.I haven't run the code yet, but I'd like to know if there is a way to train with this custom loss while being able to visualize the loss curve for each loss_ctc and loss_regularization. Will
losses = dict(loss_ctc = loss_ctc, loss_regularization = regularization_weight * loss_regularization)
do a trick? Or, for example, will changing intolosses = dict(total_loss = total_loss, loss_ctc = loss_ctc.detach(), loss_regularization = loss_regularization.detach())
still work properly?Beta Was this translation helpful? Give feedback.
All reactions