Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

Module: tfmot.sparsity.keras

Module containing sparsity code built on Keras abstractions.

Defined in python/core/api/sparsity/keras/


class ConstantSparsity: Pruning schedule with constant sparsity(%) throughout training.

class PolynomialDecay: Pruning Schedule with a PolynomialDecay function.

class PrunableLayer: Abstract Base Class for making your own keras layer prunable.

class PruningSchedule: Specifies when to prune layer and the sparsity(%) at each training step.

class PruningSummaries: A Keras callback for adding pruning summaries to tensorboard.

class UpdatePruningStep: Keras callback which updates pruning wrappers with the optimizer step.


prune_low_magnitude(...): Modify a keras layer or model to be pruned during training.

prune_scope(...): Provides a scope in which Pruned layers and models can be deserialized.

strip_pruning(...): Strip pruning wrappers from the model.