<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/model-optimization/blob/v0.8.1/tensorflow_model_optimization/python/core/sparsity/keras/pruning_callbacks.py#L82-L141) |

A Keras callback for adding pruning summaries to tensorboard.

    tfmot.sparsity.keras.PruningSummaries(
        log_dir, update_freq='epoch', **kwargs
    )

### Used in the notebooks

| Used in the guide |
|---|
| - [Pruning comprehensive guide](https://www.tensorflow.org/model_optimization/guide/pruning/comprehensive_guide) - [Pruning for on-device inference w/ XNNPACK](https://www.tensorflow.org/model_optimization/guide/pruning/pruning_for_on_device_inference) - [Pruning in Keras example](https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras) |

Logs the sparsity(%) and threshold at a given iteration step.

## Methods

### `set_model`

    set_model(
        model
    )

Sets TF-Keras model and writes graph if specified.

### `set_params`

    set_params(
        params
    )