# Showing prediction output in Keras [closed]

I am doing a image classification with CNN using Keras. The training process was so far so good. But when it comes to the prediction, I couldn't figure out to extract correct prediction results out of numpy array from predict(x). It is binary classification task but I used softmax layer at the end purposefully. The original labels should look like this:

[0 1 0 1 1 1 0 0]

But I have this from predict:

[[ 1.00000000e+00 0.00000000e+00]
[ 1.00000000e+00 1.13929331e-32]
[ 1.00000000e+00 0.00000000e+00]
[ 1.00000000e+00 1.51848069e-28]
[ 1.00000000e+00 3.70465143e-38]
[ 1.00000000e+00 5.44319748e-37]
[ 1.00000000e+00 0.00000000e+00]
[ 1.00000000e+00 0.00000000e+00]]

Apparently, there is a pattern in the output with ones and super small numbers that resembles the real labels although these small numbers should be greater than the ones before them. How can I transform it to look like the original one.

To get the prediction label, for each row, find the max probability and return the index. Can be done using numpy.argmax
• ok, I see your question, are are asking the difference between 0 and a super small number, like $1.1\times 10^{-32}$. With this detail, it is hard to answer why this happen for me. – Haitao Du Sep 19 '17 at 16:48