The 'input' is the softmax score (0-1).
If k-th class does not show in an input, the accumulative softmax score of all time steps for k-th class is very likely to be 0. Then this will result into torch.log(input) = nan.
How do you make sure that 'input' does not equal to 0 for 'torch.log(input)'
for this line: torch.log(input)
The 'input' is the softmax score (0-1). If k-th class does not show in an input, the accumulative softmax score of all time steps for k-th class is very likely to be 0. Then this will result into torch.log(input) = nan.
How do you make sure that 'input' does not equal to 0 for 'torch.log(input)'