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

the value of MarginInnerProduct param #124

Open
ghost opened this issue Sep 2, 2019 · 2 comments
Open

the value of MarginInnerProduct param #124

ghost opened this issue Sep 2, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 2, 2019

Thanks for opening code!

I found that there were same parameters int the MarginInnerProduct layer, such as base and gamma. In your protext file, the values of base and gamma are 1000 and 0.12 respectively. Now, in my task, the class number of data is 1256, how should I set their values?

In addition, I add the accuracy in the training protext file and found that the accuracy of classification is just about 0.6. Is that the A-softmax improves the accuracy of recognition, but reduces the accuracy of classification?

@wy1iu
Copy link
Owner

wy1iu commented Sep 2, 2019

The training accuracy in the training protext is not the true accuracy of the model. Because when you are training the network with A-Softmax (say with m=4), you are actually using a harder classification rule than the standard classification. The network will classify the sample correcly only if the sample are achieving a large margin criterion, but in fact, the sample can be also successfully classified in testing even if it does not fully satisfy the m=4 large margin criterion.

If you want to show the training accuracy, you might need to modify the computation of the training accuracy in the training protext file in order to make it comparable with the computation of the testing accuracy.

Overall, it is unlikely that A-Softmax loss will reduce the classification accuracy (if you train it successfully).

@ghost
Copy link
Author

ghost commented Sep 3, 2019

The training accuracy in the training protext is not the true accuracy of the model. Because when you are training the network with A-Softmax (say with m=4), you are actually using a harder classification rule than the standard classification. The network will classify the sample correcly only if the sample are achieving a large margin criterion, but in fact, the sample can be also successfully classified in testing even if it does not fully satisfy the m=4 large margin criterion.

If you want to show the training accuracy, you might need to modify the computation of the training accuracy in the training protext file in order to make it comparable with the computation of the testing accuracy.

Overall, it is unlikely that A-Softmax loss will reduce the classification accuracy (if you train it successfully).

Thank you for your reply!
I am still confused about how to set the values of MarginInnerProduct parameters(such as base and gamma) base on my data(such as number of categories and number of samples).

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

1 participant