Skip to content
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

About Outputs #11

Open
longlongvip opened this issue Jan 29, 2020 · 1 comment
Open

About Outputs #11

longlongvip opened this issue Jan 29, 2020 · 1 comment

Comments

@longlongvip
Copy link

I read your code carefully. In train.py, I'm not sure what outputs means. Is it the output of the model FC layer or the Softmax layer?
Because if it's the output of the FC layer, then it's contradictory to _ predicted = outputs.max (1), and if it's the output of the Softmax layer, it's contradictory to loss = criterion (outputs, y). What's going on?
Please take the precious time to help me, because I urgently need to get the correct conclusion and thank you for your help.

@yu4u
Copy link
Owner

yu4u commented Jan 30, 2020

The output of the model is logits (the output of the FC layer), not that of softmax.

Please refer to https://pytorch.org/docs/stable/torch.html#torch.max

outputs.max(1) is the same as torch.max(outputs, 1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants