google / qkeras

QKeras: a quantization deep learning library for Tensorflow Keras
Apache License 2.0
537 stars 104 forks source link

Int4 Quantization support #41

Closed puranjaymohan closed 4 years ago

puranjaymohan commented 4 years ago

Hi! I want to get started with using this library, specifically for int4 quantization support. I have already built a model using Keras and want to quantize it to int4. Does this library have something similar to tflite converter? Also I have used representative datasets when I used tflite for int8 quantization, does this library also require something of that sort.

Thanks

zhuangh commented 4 years ago

Hi @puranjaymohan

Nice to hear from you. But we do not have tflite converter and representative datasets at this moment.

Regarding your model, you could change your Keras model to QKeras counterpart, e.g., use qlayers, make the kernel quantizer to be quantized_bits(4,4) something like that.

A good reference from our notebook https://github.com/google/qkeras/blob/master/notebook/QKerasTutorial.ipynb

Thank you for your interest!

zhuangh commented 4 years ago

close it, feel free to reopen if you have more questions