-
Notifications
You must be signed in to change notification settings - Fork 39
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
Dice Loss Error #2
Comments
Hey, thanks for asking. dice_loss_for_NLP/tasks/tnews/train.py Line 139 in 418d09d
we recommend using the following setting for multi-class tasks: $ loss_fct = DiceLoss(square_denominator=True, with_logits=False, index_label_position=True,
smooth=1, ohem_ratio=0, alpha=0.01, reduction="none")
$ loss_fct(input_probs, target)
> tensor([0.0079, 0.0079])
$ loss_fct(input_probs, target)
> tensor([0.0151, 0.0151]) These are in line with our expectations. |
@xiaoya-li : Let me try it out, also can you recommend the settings for Multi-Label classification and NER task.
|
I have also met question 1, do you have any solution?@albertnanda |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have two part question,
dice_loss_for_NLP/loss/dice_loss.py
Line 41 in 418d09d
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
(torch.sum(torch.square(flat_input, ), -1) + torch.sum(torch.square(flat_target), -1) + self.smooth))
smooth. Is this the expected behavior or am I missing something.
Output
tensor([1.9998, 1.9998], grad_fn=)
The text was updated successfully, but these errors were encountered: