yamle.quantization.qat package#
- class yamle.quantization.qat.QATQuantizer(learning_rate, epochs, *args, **kwargs)[source]#
Bases:
BaseQuantizerThis is the quantization-aware training quantizer class.
It performs quantization-aware training on the model. In contrast to the static quantizer, the quantizer uses the calibration (validation) dataset to fine-tune the model. It uses the same optimiser as the one used for training the model.
- Parameters:
- prepare(trainer, method)[source]#
This method is used to prepare the model for quantization.
It caches the original hyperparameters for the optimisation and replaces the hyperparameters with the ones for the fine-tuning.
- Return type:
None
- cleanup(method, trainer, *args, **kwargs)[source]#
This method is used to clean up the model after quantization.
- Return type:
None