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

nnp_softmax_output bug #174

Open
klyukinds opened this issue Nov 20, 2019 · 0 comments
Open

nnp_softmax_output bug #174

klyukinds opened this issue Nov 20, 2019 · 0 comments

Comments

@klyukinds
Copy link

klyukinds commented Nov 20, 2019

Good day, everyone!
Recently, i've noticed that nnp_softmax_output result is buggy(imho) for some inputs.
Examples:
First one :
std::vector<float> input {9.34623, 8.43469, 7.19462, 6.59385, 5.89481, 5.67304}; std::vector<float> output(6); nnp_softmax_output(1, 6, input.data(), output.data(), nullptr);
example's output will be :
0.571349, 0.285674, 0.0714186, 0.0357093, 0.0178546, 0.0178546
And it sum's to : 0.99986 which is not equal to 1 !
Ground truth values for this input:
0.61010081, 0.24520245, 0.07095275, 0.03890972, 0.01934056, 0.01549371

Second:
This time i take a part of previous input, for example first three numbers:
std::vector<float> input {9.34623, 8.43469, 7.19462}; std::vector<float> output(3); nnp_softmax_output(1, 3, input.data(), output.data(), nullptr);
The output will be :
0.658674, 0.264724, 0.0766017
And the sum is exactly 1

Please help me to find a reason, why i have such behaviour, which have strong relation to the size of the input ?

I use libnnpack compiled for x86 processror with avx2.
Thank you in advance!

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