File tree Expand file tree Collapse file tree 2 files changed +1
-14
lines changed
tensorflow_model_optimization/g3doc/guide/pruning Expand file tree Collapse file tree 2 files changed +1
-14
lines changed Original file line number Diff line number Diff line change 810
810
},
811
811
"outputs" : [],
812
812
"source" : [
813
- " # Define the model.\n " ,
814
- " base_model = setup_model()\n " ,
815
- " base_model.load_weights(pretrained_weights) # optional but recommended for model accuracy\n " ,
816
- " model_for_pruning = tfmot.sparsity.keras.prune_low_magnitude(base_model)\n " ,
817
- " \n " ,
818
- " # Typically you train the model here.\n " ,
819
- " \n " ,
820
- " model_for_export = tfmot.sparsity.keras.strip_pruning(model_for_pruning)\n " ,
821
- " \n " ,
822
- " print(\" final model\" )\n " ,
823
- " model_for_export.summary()\n " ,
824
- " \n " ,
825
- " print(\"\\ n\" )\n " ,
826
813
" # Define the model.\n " ,
827
814
" base_model = setup_model()\n " ,
828
815
" base_model.load_weights(pretrained_weights) # optional but recommended for model accuracy\n " ,
Original file line number Diff line number Diff line change 91
91
" 1. Train a `tf.keras` model for MNIST from scratch.\n " ,
92
92
" 2. Fine tune the model by applying the pruning API and see the accuracy.\n " ,
93
93
" 3. Create 3x smaller TF and TFLite models from pruning.\n " ,
94
- " 4. Create a 10x TFLite smaller model from combining pruning and post-training quantization.\n " ,
94
+ " 4. Create a 10x smaller TFLite model from combining pruning and post-training quantization.\n " ,
95
95
" 5. See the persistence of accuracy from TF to TFLite."
96
96
]
97
97
},
You can’t perform that action at this time.
0 commit comments