Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'quantization' mean in interpreter.get_input_details()?

Using tflite and getting properties of interpreter like :

print(interpreter.get_input_details())

[{'name': 'input_1_1', 'index': 47, 'shape': array([  1, 128, 128,   3], dtype=int32), 'dtype': <class 'numpy.uint8'>, 'quantization': (0.003921568859368563, 0)}]

What does 'quantization': (0.003921568859368563, 0) mean?

like image 264
mrgloom Avatar asked Feb 22 '19 15:02

mrgloom


1 Answers

It means quantization parameters values: scale and zero_point of input tensor.

This is necessary to convert a quantized uint8 number q to floating point number f using formula:

f = (q - zero_point) * scale
like image 65
Aleksandr Kondratyev Avatar answered Nov 15 '22 05:11

Aleksandr Kondratyev