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

Why don't you apply a softmax function before the final prediction? #41

Closed
zwx8981 opened this issue Sep 4, 2018 · 2 comments
Closed

Comments

@zwx8981
Copy link

zwx8981 commented Sep 4, 2018

HI, thank you for great work, I have a little question. As a classification task,we usually apply a softmax function to convert the output of a model into a probabilistic vector, each entry of which represents the probability of the input that belonging to the corresponding category. However, it seems that in your code the output of the Mutan model (the output of the second multimodel fusion followed by only a linear transformation without a softmax) is directly fed into the loss function. Is there any special consideration?

x = self.linear_classif(x)

@zwx8981 zwx8981 changed the title Why don't you apply a softmax function after the second multimodel fusion? Why don't you apply a softmax function before the final prediction? Sep 4, 2018
@Cadene
Copy link
Owner

Cadene commented Sep 4, 2018

@zwx8981 Here we use nn.CrossEntropyLoss which combines nn.LogSoftmax and nn.NLLLoss. Thus, we don't need to add a softmax. It is already included.

@Cadene Cadene closed this as completed Sep 4, 2018
@zwx8981
Copy link
Author

zwx8981 commented Sep 5, 2018

@Cadene Thank you!

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