BaseKerasTrainableQuantizer
is an interface that enables easy quantizers development and training.
Using this base class makes it simple to implement new quantizers for training and inference for weights or activations.
BaseKerasTrainableQuantizer
constitutes a base class for trainable quantizers of specific of specific tasks, such as QAT.
The @mark_quantizer
decorator is used to supply each quantizer with static properties which define its task compatibility. Each quantizer class should be decorated with this decorator. It defines the following properties:
QuantizationTarget
: An Enum that indicates whether the quantizer is designated for weights or activations quantization.QuantizationMethod
: A list of quantization methods (Uniform, Symmetric, etc.).identifier
: A unique identifier for the quantizer class. This is a helper property that allows the creation of advanced quantizers for specific tasks.
Note that the @mark_quantizer
decorator, and the QuantizationTarget
and QuantizationMethod
enums are provided by the external MCT Quantizers package.
Examples of Trainable Activation quantizers can be found here Activation Quantizers and Trainable Weight quantizers here QAT Weight Quantizers