Skip to content

Commit b278157

Browse files
Merge pull request #880 from wwwind:sparsity24_docs
PiperOrigin-RevId: 421717857
2 parents 2dfacf6 + 47eda03 commit b278157

File tree

3 files changed

+715
-5
lines changed

3 files changed

+715
-5
lines changed

tensorflow_model_optimization/g3doc/_book.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ upper_tabs:
3333
path: /model_optimization/guide/pruning/comprehensive_guide
3434
- title: Pruning for on-device inference with XNNPACK
3535
path: /model_optimization/guide/pruning/pruning_for_on_device_inference
36+
- title: Sparse weights using structural pruning
37+
path: /model_optimization/guide/pruning/pruning_with_sparsity_2_by_4
3638

3739
- heading: Quantization
3840
- title: Quantization aware training overview

tensorflow_model_optimization/g3doc/guide/pruning/index.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Trim insignificant weights
22

3-
<sub>Maintained by TensorFlow Model Optimization</sub>
4-
53
This document provides an overview on model pruning to help you determine how it
64
fits with your use case.
75

@@ -11,6 +9,8 @@ fits with your use case.
119
[pruning comprehensive guide](comprehensive_guide.ipynb).
1210
* To explore the application of pruning for on-device inference, see the
1311
[Pruning for on-device inference with XNNPACK](pruning_for_on_device_inference.ipynb).
12+
* To see an example of structural pruning, run the tutorial
13+
[Structural pruning with 2 by 4 sparsity](pruning_with_sparsity_2_by_4.ipynb).
1414

1515
## Overview
1616

@@ -50,14 +50,18 @@ It is on our roadmap to add support in the following areas:
5050
<tr>
5151
<th>Model</th>
5252
<th>Non-sparse Top-1 Accuracy </th>
53-
<th>Sparse Accuracy </th>
54-
<th>Sparsity </th>
53+
<th>Random Sparse Accuracy </th>
54+
<th>Random Sparsity </th>
55+
<th>Structured Sparse Accuracy</th>
56+
<th>Structured Sparsity </th>
5557
</tr>
5658
<tr>
5759
<td rowspan=3>InceptionV3</td>
5860
<td rowspan=3>78.1%</td>
5961
<td>78.0%</td>
6062
<td>50%</td>
63+
<td>75.8%</td>
64+
<td>2 by 4</td>
6165
</tr>
6266
<tr>
6367
<td>76.1%</td><td>75%</td>
@@ -66,7 +70,10 @@ It is on our roadmap to add support in the following areas:
6670
<td>74.6%</td><td>87.5%</td>
6771
</tr>
6872
<tr>
69-
<td>MobilenetV1 224</td><td>71.04%</td><td>70.84%</td><td>50%</td>
73+
<td>MobilenetV1 224</td><td>71.04%</td><td>70.84%</td><td>50%</td><td>67.35%</td><td>2 by 4</td>
74+
</tr>
75+
<tr>
76+
<td>MobilenetV2 224</td><td>71.77%</td><td>69.64%</td><td>50%</td><td>66.75%</td><td>2 by 4</td>
7077
</tr>
7178
</table>
7279
</figure>
@@ -113,6 +120,29 @@ The models were tested on Imagenet.
113120
The models use WMT16 German and English dataset with news-test2013 as the dev
114121
set and news-test2015 as the test set.
115122

123+
### Keyword spotting model
124+
125+
DS-CNN-L is a keyword spotting model created for edge devices. It can be found
126+
in ARM software's
127+
[examples repository](https://github.com/ARM-software/ML-examples/tree/master/tflu-kws-cortex-m).
128+
129+
<figure>
130+
<table>
131+
<tr>
132+
<th>Model</th>
133+
<th>Non-sparse Accuracy</th>
134+
<th>Structured Sparse Accuracy (2 by 4 pattern)</th>
135+
<th>Random Sparse Accuracy (target sparsity 50%)</th>
136+
</tr>
137+
<tr>
138+
<td>DS-CNN-L</td>
139+
<td>95.23</td>
140+
<td>94.33</td>
141+
<td>94.84</td>
142+
</tr>
143+
</table>
144+
</figure>
145+
116146
## Examples
117147

118148
In addition to the [Prune with Keras](pruning_with_keras.ipynb)

0 commit comments

Comments
 (0)