The construction function of class VitisQuantizer
.
vitis_quantize.VitisQuantizer(
float_model,
quantize_strategy='8bit',
custom_quantize_strategy=None,
custom_objects={})
Arguments
- model
- A
tf.keras.Model
object, containing the configurations for quantization. - quantize_strategy
- A string object of the quantize strategy type. Available values are
8bit and 8bit_tqt.
8bit is the default strategy that uses the
Straight-Through-Estimator. 8bit_tqt is a new strategy
introduced in Vitis AI 1.4 which uses
Trained-Threshold in quantizers and may better results for QAT. Note: 8bit_tqt strategy should only be used in QAT and be used together with
init_quant=True
to get the best performance. - custom_quantize_strategy
- A string object, the file path of custom quantize strategy JSON file.
- custom_objects
- A Dict object, mapping names (strings) to custom classes or functions.