SHARE
TWEET

Untitled

a guest Apr 25th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import tensorflow_model_optimization as tfmot
  2.  
  3. model = build_your_model()  
  4.  
  5. pruning_params = {
  6.   'pruning_schedule': tfmot.sparsity.keras.PolynomialDecay(
  7.                         initial_sparsity=0.0, final_sparsity=0.5,
  8.                         begin_step=2000, end_step=4000)
  9. }
  10.  
  11. pruned_model = tfmot.sparsity.keras.prune_low_magnitude(model, **pruning_params)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top