nncf.common.pruning.schedulers
#
Classes#
This is the class from which all pruning schedulers inherit. |
- class nncf.common.pruning.schedulers.PruningScheduler(controller, params)[source]#
Bases:
nncf.common.schedulers.BaseCompressionScheduler
This is the class from which all pruning schedulers inherit.
A pruning scheduler is an object which specifies the pruning level at each training epoch. It involves a scheduling algorithm, defined in the _calculate_pruning_level() method and a state (some parameters required for current pruning level calculation) defined in the __init__() method.
- Parameters:
controller (nncf.api.compression.CompressionAlgorithmController) – Pruning algorithm controller.
params (dict) – Parameters of the scheduler in the JSON-like dictionary form. Passed as-is from the corresponding section of the NNCF config file .json section (https://openvinotoolkit.github.io/nncf/schema).
- property current_pruning_level: float[source]#
Returns pruning level for the current_epoch.
- Returns:
Current sparsity level.
- Return type:
float
- epoch_step(next_epoch=None)[source]#
Should be called at the beginning of each training epoch to prepare the pruning method to continue training the model in the next_epoch.
- Parameters:
next_epoch (Optional[int]) – The epoch index for which the pruning scheduler will update the state of the pruning method.
- Return type:
None
- step(next_step=None)[source]#
Should be called at the beginning of each training step to prepare the pruning method to continue training the model in the next_step.
- Parameters:
next_step (Optional[int]) – The global step index for which the pruning scheduler will update the state of the pruning method.
- Return type:
None