-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Model with softmax output layer not outputing probabilities but just 1 and 0 #8271
Comments
Hi, @croraf I apologize for the delayed response and you're absolutely right. The final layer in your model Could you please try the below code snippet and see if it is working as expected or not ? If the issue still persists please let us know. Thank you for your cooperation and patience.
|
Hi, @croraf I apologize for the delayed response, could you please try something like below and see is it working as expected or not? if not please help me with your Github repo to replicate the same behavior from our end to investigate this issue further.
Thank you for your cooperation and patience. |
Hi @gaikwadrahul8 . It is the same. I get: Here is my repo: https://github.com/croraf/x-ray-ai (it has a README) After training The repo is basically a reproduction of example in |
I'm testing the model provided in node-js example https://github.com/tensorflow/tfjs-examples/blob/master/mnist-node/model.js to classify images of numbers into classes 0 to 9.
It is a
tf.sequential()
model, and its final layer ismodel.add(tf.layers.dense({ units: 10, activation: "softmax" }));
Therefore the prediction should output probabilities per class, but this is not happening. Instead only 0s and 1s (in a one-hot fashion) are outputed in the following logging.
How to get the probabilities of specific image belonging to specific class
The text was updated successfully, but these errors were encountered: