|View source on GitHub|
Pruning schedule with constant sparsity(%) throughout training.
__init__( target_sparsity, begin_step, end_step=-1, frequency=100 )
Initializes a Pruning schedule with constant sparsity.
Sparsity is applied in the interval [
frequency steps. At each applicable step, the sparsity(%) is constant.
target_sparsity: A scalar float representing the target sparsity value.
begin_step: Step at which to begin pruning.
end_step: Step at which to end pruning.
-1implies continuing to prune till the end of training.
frequency: Only apply pruning every
Returns the sparsity(%) to be applied.
If the returned sparsity(%) is 0, pruning is ignored for the step.
step: Current step in graph execution.
Sparsity (%) that should be applied to the weights for the step.
from_config( cls, config )
PruningSchedule from its config.
config: Output of