nncf.tensorflow.quantization.algorithm
#
Classes#
Controller for the quantization algorithm in TensorFlow. |
- class nncf.tensorflow.quantization.algorithm.QuantizationController(target_model, config, op_names)[source]#
Bases:
nncf.common.compression.BaseCompressionAlgorithmController
Controller for the quantization algorithm in TensorFlow.
- Parameters:
config (nncf.NNCFConfig) –
op_names (List[str]) –
- property scheduler: nncf.api.compression.CompressionScheduler[source]#
The compression scheduler for this particular algorithm combination.
- Return type:
- property loss: nncf.api.compression.CompressionLoss[source]#
Returns the loss that is always zero since the quantization algorithm is driven by the original loss and does not require additional losses.
- Return type:
- strip_model(model, do_copy=False)[source]#
Strips auxiliary layers that were used for the model compression, as it’s only needed for training. The method is used before exporting the model in the target format.
- Parameters:
model (tensorflow.keras.Model) – The compressed model.
do_copy (bool) – Modify copy of the model, defaults to False.
- Returns:
The stripped model.
- Return type:
tensorflow.keras.Model
- statistics(quickly_collected_only=False)[source]#
Returns a Statistics class instance that contains compression algorithm statistics.
- Parameters:
quickly_collected_only (bool) – Enables collection of the statistics that don’t take too much time to compute. Can be helpful for the case when need to keep track of statistics on each training batch/step/iteration.
- Return type: