Git Product home page Git Product logo

Comments (9)

dominicsymes avatar dominicsymes commented on September 26, 2024 1

Hi. Can I just ask which code this issue refers to as the TFL int16 reference code.
If it is reference_ops::Tanh() that calls gemlowp::tanh() then this has a difference of 6 for sigmoid and 12 for tanh for int16 Q12 input.
However, I think TFLite no longer uses this for reference for int16 tanh and now uses reference_integer_ops::Tanh() that is more accurate, within I think +/-1 for int16 Q12
(for example https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/activations.cc#L945)
So, I do not think that TFLite int16 has an issue with Tanh/sigmoid precision.

from tflite-micro.

petewarden avatar petewarden commented on September 26, 2024

Assigning to myself, though I haven't had a chance to investigate this yet.

from tflite-micro.

sushreebarsa avatar sushreebarsa commented on September 26, 2024

This is a micro related issue,Please post this in micro repository and move this issue to closed status .Thanks!

from tflite-micro.

google-ml-butler avatar google-ml-butler commented on September 26, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

from tflite-micro.

nyadla-sys avatar nyadla-sys commented on September 26, 2024

@petewarden

Can you please move this issue to tflite-micro github?

from tflite-micro.

nyadla-sys avatar nyadla-sys commented on September 26, 2024

@petewarden :A Gentle reminder.!

from tflite-micro.

advaitjain avatar advaitjain commented on September 26, 2024

@petewarden :A Gentle reminder.!

done

from tflite-micro.

lukmanr-cadence avatar lukmanr-cadence commented on September 26, 2024

Hi,
We tested reference_integer_ops::Logistic() & reference_integer_ops::Tanh() for all possible Q12 inputs.
reference_integer_ops::Logistic() is just 1 bit off for Q12 inputs.
But reference_integer_ops::Tanh() is 2 bit off for Q12 inputs and this difference increases from 2 bit to 4 bit when the input changes from Q12 to Q15.

from tflite-micro.

tingyan19 avatar tingyan19 commented on September 26, 2024

I dug a little deeper and found this:

https://github.com/tensorflow/tensorflow/blob/ee62dbd6d71243c0d7c79123f6b34d26cc048599/tensorflow/lite/kernels/activations_test.cc#L198-L215

So for Int16, 4 bits of error (2^-12) is actually expected for the TFLite implementation based on trade-off of accuracy and time/memory cost.

I will try to port the TFLite tests for int16 tanh and sigmoid (logistic) over to TFLM.

from tflite-micro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.