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 I tried myself to re-implement the code for matrix count, I noticed that there is slight difference between my nll loss and the one in notebook.
Here is what we have in video: -nll = 559891.75
but here what I got: -nll = 559873.5915061831
The difference is about 18.
After reviewing both codes, I found out that the issue is with .item(). It converts the tensor to python number.
In the notebook, this has been calculated as logprob:
When I tried myself to re-implement the code for matrix count, I noticed that there is slight difference between my
nll
loss and the one in notebook.Here is what we have in video:
-nll = 559891.75
but here what I got:
-nll = 559873.5915061831
The difference is about
18
.After reviewing both codes, I found out that the issue is with
.item()
. It converts the tensor to python number.In the notebook, this has been calculated as
logprob
:But I have calculated this:
Here is example:
In pytorch item, there is nothing mentioned about this.
The text was updated successfully, but these errors were encountered: