You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
您好,我现在想在ner的任务中使用dice_loss,我的设置如下:
a = torch.rand(13,3)
b = torch.tensor([0,1,1,1,1,1,1,1,1,1,1,1,2])
f = DiceLoss(with_logits=True,smooth=1, ohem_ratio=0.3,alpha=0.01)
f(a,b)
当我运行之后,报错如下:
发生异常: TypeError
unsupported operand type(s) for &: 'int' and 'Tensor'
您好,我现在想在ner的任务中使用dice_loss,我的设置如下:
a = torch.rand(13,3)
b = torch.tensor([0,1,1,1,1,1,1,1,1,1,1,1,2])
f = DiceLoss(with_logits=True,smooth=1, ohem_ratio=0.3,alpha=0.01)
f(a,b)
当我运行之后,报错如下:
发生异常: TypeError
unsupported operand type(s) for &: 'int' and 'Tensor'
报错的位置在 _multiple_class
cond = (torch.argmax(flat_input, dim=1) == label_idx & flat_input[:, label_idx] >= threshold) | pos_example.view(-1)
或许是先运行了label_idx & flat...
由于我没有仔细阅读论文中的算法描述,所以并不清楚这一部分的逻辑,也不知道如何修改,特来请教!
The text was updated successfully, but these errors were encountered: