GiorgosXou / NeuralNetworks

A resource-conscious neural network implementation for MCUs
MIT License
70 stars 21 forks source link

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

Open GiorgosXou opened 3 months ago

GiorgosXou commented 3 months ago

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 commented 3 months ago

I'm looking for solution as of right now

GiorgosXou commented 3 months ago

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

GiorgosXou commented 3 months ago

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

GiorgosXou commented 3 months ago

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

GiorgosXou commented 3 months ago

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)