tfmot.experimental.combine.strip_clustering_cqat
Stay organized with collections
Save and categorize content based on your preferences.
Strip clustering variables from the model.
tfmot.experimental.combine.strip_clustering_cqat(
to_strip
)
During cluster-preserve quantization aware training (CQAT), centroids,
cluster associations, and original weights are added to the training graph.
After the CQAT is done, these variables should be removed and the layer
with the clustered weights should be restored.
Returns |
A keras model or layer with clustering variables removed.
|
Raises |
ValueError
|
if the model is not a tf.keras.Model instance.
|
NotImplementedError
|
if the model is a subclassed model.
|
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.experimental.combine.strip_clustering_cqat\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/quantization/keras/collab_opts/cluster_preserve/cluster_utils.py#L42-L124) |\n\nStrip clustering variables from the model. \n\n tfmot.experimental.combine.strip_clustering_cqat(\n to_strip\n )\n\nDuring cluster-preserve quantization aware training (CQAT), centroids,\ncluster associations, and original weights are added to the training graph.\nAfter the CQAT is done, these variables should be removed and the layer\nwith the clustered weights should be restored.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `to_strip` | A [`tf.keras.Model`](https://www.tensorflow.org/api_docs/python/tf/keras/Model) instance with clustered layers or a [`tf.keras.layers.Layer`](https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer) instance |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A keras model or layer with clustering variables removed. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-----------------------|---------------------------------------------------------------------------------------------------------------|\n| `ValueError` | if the model is not a [`tf.keras.Model`](https://www.tensorflow.org/api_docs/python/tf/keras/Model) instance. |\n| `NotImplementedError` | if the model is a subclassed model. |\n\n\u003cbr /\u003e"]]