Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement