import tensorflow as tf import tensorflow_model_optimization as tfmot model = tf.keras.Sequential([...]) pruning_schedule = tfmot.sparsity.keras.PolynomialDecay( initial_sparsity=0.0, final_sparsity=0.5, begin_step=2000, end_step=4000) model_for_pruning = tfmot.sparsity.keras.prune_low_magnitude( model, pruning_schedule=pruning_schedule) ... model_for_pruning.fit(...) TensorFlow Model Optimization
![TensorFlow Model Optimization](https://cdn-ak-scissors.b.st-hatena.com/image/square/bdb5e91dc4d40d76381787e230e41d8a6eb0f253/height=288;version=1;width=512/https%3A%2F%2Fwww.tensorflow.org%2Fstatic%2Fimages%2Ftf_logo_social.png%3Fhl%3Dja)