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
when running label smoothing section, I found the code 'crit(x=predict, target=torch.LongTensor([2, 1, 0, 3, 3]))' return inf.
I think the var predict shouldn't add log, for log(0) is -inf. and the loss section draws nothing.
The text was updated successfully, but these errors were encountered:
Hi jerett - we need the inputs of KLDivLoss to be in log space. Hence we need to apply log() - The -inf issue is because we have zeros in the tensor. So the log() applied to the predict tensor is creating issue with LabelSmoothing().
Hence I propose to use softmax_log() instead of log()
when running label smoothing section, I found the code 'crit(x=predict, target=torch.LongTensor([2, 1, 0, 3, 3]))' return inf.
I think the var predict shouldn't add log, for log(0) is -inf. and the loss section draws nothing.
The text was updated successfully, but these errors were encountered: