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
LogSoftmax in the output but not in the description/code (page 532) #37
Comments
Good catch. I remember seeing it and flagging it in several places. It's unfortunate that one of it slipped through! You are right, E.g., consider the example data: import torch.nn.functional as F
logits = torch.tensor([
[-1.1, 0.1],
[-0.4, 2.1],
[3.1, -1.1]]
)
y_target = torch.tensor([1, 0, 1]) Then
and
Because >>> log_softmax == torch.log(F.softmax(log_softmax, dim=1))
tensor([[True, True],
[True, True],
[True, True]]) The PS: Thanks for all the other comments. Please keep posting! I am trying to catch up in the next couple of days. |
Hi Sebastian, Yes I mean it is not used anywhere in the code and in the following steps :) |
Added it to the errata. |
Hi Sebastian,
There is an output of created RNN model which includes log softmax as the last layer on the page 532:
But based on the code of the model and on the following steps we do not need this layer because we use nn.CrossEntropyLoss() where the input is expected to contain raw, unnormalized scores for each class.
Is it correct?
Thank you.
The text was updated successfully, but these errors were encountered: