Questions tagged [quantization]

Use this tag for questions related to quantization of any kind, such as vector quantization.

Quantization, in mathematics and digital signal processing, is the process of mapping a large set of input values to a (countable) smaller set.

For more, please read the Wikipedia article for more.

444 questions
2
votes
4 answers

Is it possible to optimize this Matlab code for doing vector quantization with centroids from k-means?

I've created a codebook using k-means of size 4000x300 (4000 centroids, each with 300 features). Using the codebook, I then want to label an input vector (for purposes of binning later on). The input vector is of size Nx300, where N is the total…
Abe Schneider
  • 977
  • 1
  • 11
  • 23
2
votes
0 answers

Tensorflow OID4 mobilenet model not quantizing correctly

I'm trying to quantize the ssd_mobilenetv2_oidv4 model from Tensorflow object detection model zoo, but after quantization the model stops working entirely. To get the tflite graph, I ran export_tflite_ssd_graph.py…
2
votes
3 answers

How to quantize inputs and outputs of optimized tflite model

I use the following code to generate a quantized tflite model import tensorflow as tf def representative_dataset_gen(): for _ in range(num_calibration_steps): # Get sample input data as a numpy array in a method of your choosing. yield…
Ivan Kovtun
  • 645
  • 1
  • 11
  • 18
2
votes
0 answers

Loading tensorflow object detection model post-training quantization to fp16 is extremely slow

Here I get a tensorflow object detection model through its provided object detection api. For some Nvidia GPUs (V-series, P100, ...) have supported float16 for faster training and inference, truncating weights from float32 to float16 seems to be a…
zong fan
  • 386
  • 3
  • 9
2
votes
0 answers

I want to know how to perform quantization-aware training for deeplab-v3+

I have been trying to perform quantization aware training for deeplab using the guide given in this link https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/quantize However, I am not sure where exactly to put the below 2 lines…
2
votes
0 answers

Quantization aware (re)training a keras model

I have a (trained) tf.keras model which I would like to convert to a quantized model and retrain with tensorflow's fake quant strategy (using python as frontend). Could I somehow apply tf.contrib.quantize.create_training_graph directly to the keras…
Daugmented
  • 220
  • 1
  • 9
2
votes
0 answers

Accuracy drop for Tensorflow object detection Post Quantization

I am fine-tuning SSD Mobilenet v2 for a custom dataset. I am fine-tuning the model for 50k steps and quantization aware training kicks in at 48k step count. graph_rewriter { quantization { delay: 48000 weight_bits: 8 activation_bits:…
Anil Maddala
  • 898
  • 16
  • 34
2
votes
2 answers

Fraction based quantization of a value

I'm developing a basic Python 2.7 musical sequencer. A small background for people not used to musical terms. A sequencer is a program that can "ask" some other program or device to "play" events at specific times, somehow similar to the …
musicamante
  • 41,230
  • 6
  • 33
  • 58
2
votes
0 answers

How to reduce image bit-depth (Quantization) with Swift?

is there a way on iPhone to reduce image bit-depth. I'm trying to reduce the image size to less than 1 MB but I don't want change the image width and height. so reducing the image resolution might be the correct way to do that. Anyone know how to do…
Ahmad
  • 35
  • 4
2
votes
0 answers

Quantization support in Keras

I have a model that is trained in Keras with tensor flow backend. The weights are in .h5 format. I am interested in applying quantization feature part of tensorflow (https://www.tensorflow.org/api_docs/python/tf/quantization). So far, I have managed…
user10193823
  • 41
  • 1
  • 4
2
votes
1 answer

General way to quantize floating point numbers into arbitrary number of bins?

I want to quantize a series of numbers which have a maximum and minimum value of X and Y respectively into arbitrary number of bins. For instance, if the maximum value of my array is 65535 and the minimum is 0 (do not assume these are all integers)…
Amir
  • 10,600
  • 9
  • 48
  • 75
2
votes
1 answer

How 8 bit arithmetic is done in Tensorflow?

This TensorFlow guide gives some insights on 8 bit representation of the neural network weight and activations. It maps the range from min-max in float32 to 8bit format by mapping min value in float32 to 0 in int8 and max value to 255. This means…
gopal_hegde
  • 43
  • 1
  • 5
2
votes
0 answers

Using different quantization modes in Tensorflow?

TF's documentation on their quantization script appears to only include --mode=eightbit (July 24, 2017). What are each of the modes used for? i.e. as indicated in quantize_graph.py (round, quantize, weights,…
jaydee713
  • 161
  • 1
  • 2
  • 9
2
votes
1 answer

Forcing symmetric quantization in TensorFlow

For various hardware and software performance reasons I want to force a symmetric quantization in TensorFlow. I figure the quickest way to try this out and compare its accuracy with the existing asymmetric quantization is to set the quantization max…
Sean
  • 21
  • 1
2
votes
2 answers

Quantize grayscale images

I have grayscale images which I want to quantize to different gray levels. To be more precise, in the EBImage package, we have a function equalize() which has an argument levels. we can set levels value to 256 or 128 or 64 etc to quantize our…
lijin
  • 36
  • 4