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

Fix deep model last layer bug #14

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Fix deep model last layer bug #14

merged 1 commit into from
Jun 13, 2024

Conversation

amir-haji
Copy link
Contributor

@amir-haji amir-haji commented May 31, 2024

When the nn.CrossEntropyLoss is used as the criterion, regarding pytorch documentation, the loss fuction applies the softmax on the input. Therefore, there is no need to add an extra softmax layer at the end of the model.

https://github.com/sharif-ml-lab/IMDb-IR-System/blob/ab4e92b6957fe747331744d815946b4eb6b57d90/Logic/core/classification/deep.py#L28C1-L42C10?plain=1

@amirhossein-razlighi amirhossein-razlighi self-requested a review June 2, 2024 05:39
Copy link
Collaborator

@amirhossein-razlighi amirhossein-razlighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for your PR!

@amirhossein-razlighi amirhossein-razlighi merged commit 0dd0fe0 into sharif-ml-lab:main Jun 13, 2024
1 check passed
amirR01 pushed a commit that referenced this pull request Oct 21, 2024
No need for Softmax at the end because of `nn.CrossEntropyLoss`
amirR01 pushed a commit that referenced this pull request Oct 21, 2024
No need for Softmax at the end because of `nn.CrossEntropyLoss`

(cherry picked from commit 0dd0fe0)
amirR01 pushed a commit that referenced this pull request Oct 21, 2024
No need for Softmax at the end because of `nn.CrossEntropyLoss`

(cherry picked from commit 0dd0fe0)
amirR01 pushed a commit that referenced this pull request Oct 21, 2024
No need for Softmax at the end because of `nn.CrossEntropyLoss`

(cherry picked from commit 0dd0fe0)
amirR01 pushed a commit that referenced this pull request Oct 21, 2024
No need for Softmax at the end because of `nn.CrossEntropyLoss`

(cherry picked from commit 0dd0fe0)
amirR01 pushed a commit that referenced this pull request Oct 21, 2024
No need for Softmax at the end because of `nn.CrossEntropyLoss`

(cherry picked from commit 0dd0fe0)
amirR01 pushed a commit that referenced this pull request Oct 21, 2024
No need for Softmax at the end because of `nn.CrossEntropyLoss`

(cherry picked from commit 0dd0fe0)
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

Successfully merging this pull request may close these issues.

2 participants