  We describe a measure quantization procedure i.e., an algorithm which finds
the best approximation of a target probability law (and more generally signed
finite variation measure) by a sum of $Q$ Dirac masses ($Q$ being the
quantization parameter). The procedure is implemented by minimizing the
statistical distance between the original measure and its quantized version;
the distance is built from a negative definite kernel and, if necessary, can be
computed on the fly and feed to a stochastic optimization algorithm (such as
SGD, Adam, ...). We investigate theoretically the fundamental questions of
existence of the optimal measure quantizer and identify what are the required
kernel properties that guarantee suitable behavior. We propose two best linear
unbiased (BLUE) estimators for the squared statistical distance and use them in
an unbiased procedure, called HEMQ, to find the optimal quantization. We test
HEMQ on several databases: multi-dimensional Gaussian mixtures, Wiener space
cubature, Italian wine cultivars and the MNIST image database. The results
indicate that the HEMQ algorithm is robust and versatile and, for the class of
Huber-energy kernels, matches the expected intuitive behavior.
