tfmot.sparsity.keras.UpdatePruningStep
Stay organized with collections
Save and categorize content based on your preferences.
Keras callback which updates pruning wrappers with the optimizer step.
tfmot.sparsity.keras.UpdatePruningStep()
Used in the notebooks
This callback must be used when training a model which needs to be pruned. Not
doing so will throw an error.
Example:
model.fit(x, y,
callbacks=[UpdatePruningStep()])
Methods
set_model
set_model(
model
)
set_params
set_params(
params
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-05-26 UTC.
[null,null,["Last updated 2023-05-26 UTC."],[],[],null,["# tfmot.sparsity.keras.UpdatePruningStep\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/model-optimization/blob/v0.7.5/tensorflow_model_optimization/python/core/sparsity/keras/pruning_callbacks.py#L33-L76) |\n\nKeras callback which updates pruning wrappers with the optimizer step. \n\n tfmot.sparsity.keras.UpdatePruningStep()\n\n### Used in the notebooks\n\n| Used in the guide |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - [Pruning comprehensive guide](https://www.tensorflow.org/model_optimization/guide/pruning/comprehensive_guide) - [Sparsity and cluster preserving quantization aware training (PCQAT) Keras example](https://www.tensorflow.org/model_optimization/guide/combine/pcqat_example) - [Pruning preserving quantization aware training (PQAT) Keras example](https://www.tensorflow.org/model_optimization/guide/combine/pqat_example) - [Sparsity preserving clustering Keras example](https://www.tensorflow.org/model_optimization/guide/combine/sparse_clustering_example) - [Pruning for on-device inference w/ XNNPACK](https://www.tensorflow.org/model_optimization/guide/pruning/pruning_for_on_device_inference) |\n\nThis callback must be used when training a model which needs to be pruned. Not\ndoing so will throw an error.\n\n#### Example:\n\n model.fit(x, y,\n callbacks=[UpdatePruningStep()])\n\nMethods\n-------\n\n### `set_model`\n\n set_model(\n model\n )\n\n### `set_params`\n\n set_params(\n params\n )"]]