Pruning schedule with constant sparsity(%) throughout training.
Inherits From: PruningSchedule
tfmot.sparsity.keras.ConstantSparsity(
target_sparsity, begin_step, end_step=-1, frequency=100
)
Used in the notebooks
Used in the guide |
---|
Methods
from_config
@classmethod
from_config( config )
Instantiates a PruningSchedule
from its config.
Args | |
---|---|
config
|
Output of get_config() .
|
Returns | |
---|---|
A PruningSchedule instance.
|
get_config
get_config()
__call__
__call__(
step
)
Returns the sparsity(%) to be applied.
If the returned sparsity(%) is 0, pruning is ignored for the step.
Args | |
---|---|
step
|
Current step in graph execution. |
Returns | |
---|---|
Sparsity (%) that should be applied to the weights for the step. |