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

NOTE: NN.print()'s floating point precision, is inucurate at the last decimal digit. #25

Open
GiorgosXou opened this issue Mar 4, 2024 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@GiorgosXou
Copy link
Owner

This means that if you copy-paste the printed-weights from the serial output, into another neural-network, there's going to be some slight noise to the output (when you run it). This is a result of Serial.print(weights[i][j], DFLOAT_LEN); where DFLOAT_LEN is 7 but the print-function rounds it in a weirdly way.

@GiorgosXou GiorgosXou added bug Something isn't working good first issue Good for newcomers labels Mar 4, 2024
@GiorgosXou
Copy link
Owner Author

GiorgosXou commented Mar 4, 2024

I'm looking for solution as of right now

@GiorgosXou GiorgosXou changed the title NOTE: NN.print()'s floating point precision, is inucurate at the last digit. NOTE: NN.print()'s floating point precision, is inucurate at the last decimal digit. Mar 4, 2024
@GiorgosXou
Copy link
Owner Author

Usually there will be something like -3.8190280 printed as -3.8190279

@GiorgosXou
Copy link
Owner Author

GiorgosXou commented Mar 4, 2024

Like it's weird ngl.. but it's not something critical :P

@GiorgosXou
Copy link
Owner Author

Wait... might not be this, the problem...

@GiorgosXou
Copy link
Owner Author

GiorgosXou commented Mar 4, 2024

Whatever this is, causes the issue:

https://github.com/arduino/ArduinoCore-avr/blob/63092126a406402022f943ac048fa195ed7e944b/cores/arduino/Print.cpp#L223-L266

(Don't worry about the SD read\write [opposite] [str to float] i solved it using ATOL)

@GiorgosXou GiorgosXou reopened this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant