I have a question about the result value of keras cnnpredict

Asked 2 years ago, Updated 2 years ago, 82 views

Hello!

I have a question while studying CNN through Keras

The result of the prediction calculation for the model is array([[6.527474e-05, 5.269228e-05, 9.998820e-01]], dtype=float32) How do I output the result to a fixed decimal point (0.998820) when it comes to floating point like this?

keras

2022-09-21 16:47

1 Answers

I think it's not a problem with keras, but a print option problem with numpy array.

https://stackoverflow.com/questions/50771966/how-to-get-numpy-not-to-print-in-scientific-notation

When you print a numpy array, it seems to be the default to represent floating point figures in scientific notation, and you can change the option to np.set_printoptions(suppress=true) to display them in default floating point notation.

But it's just a difference in how you express the value, so I'm not sure if you should be paying attention to it unless you save it as text and read it again. If you save the result, saving the numpy value itself with a pickle will be more accurate.


2022-09-21 16:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.