Skip to content

Commit 32f2dcd

Browse files
committed
Fix incorrect header sizes in the clustering comprehensive guide
1 parent f1d1784 commit 32f2dcd

File tree

1 file changed

+80
-80
lines changed

1 file changed

+80
-80
lines changed

tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb

100755100644
Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
{
2+
"nbformat": 4,
3+
"nbformat_minor": 0,
4+
"metadata": {
5+
"celltoolbar": "Raw Cell Format",
6+
"colab": {
7+
"name": "clustering_comprehensive_guide.ipynb",
8+
"provenance": [],
9+
"private_outputs": true,
10+
"collapsed_sections": [],
11+
"toc_visible": true
12+
},
13+
"kernelspec": {
14+
"display_name": "Python 3",
15+
"language": "python",
16+
"name": "python3"
17+
},
18+
"language_info": {
19+
"codemirror_mode": {
20+
"name": "ipython",
21+
"version": 3
22+
},
23+
"file_extension": ".py",
24+
"mimetype": "text/x-python",
25+
"name": "python",
26+
"nbconvert_exporter": "python",
27+
"pygments_lexer": "ipython3",
28+
"version": "3.6.9"
29+
}
30+
},
231
"cells": [
332
{
433
"cell_type": "markdown",
@@ -7,19 +36,17 @@
736
"id": "826IBSWMN4rr"
837
},
938
"source": [
10-
"**Copyright 2020 The TensorFlow Authors.**"
39+
"##### Copyright 2020 The TensorFlow Authors."
1140
]
1241
},
1342
{
1443
"cell_type": "code",
15-
"execution_count": null,
1644
"metadata": {
1745
"cellView": "form",
18-
"colab": {},
1946
"colab_type": "code",
20-
"id": "ITj3u97-tNR7"
47+
"id": "ITj3u97-tNR7",
48+
"colab": {}
2149
},
22-
"outputs": [],
2350
"source": [
2451
"#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n",
2552
"# you may not use this file except in compliance with the License.\n",
@@ -32,7 +59,9 @@
3259
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
3360
"# See the License for the specific language governing permissions and\n",
3461
"# limitations under the License."
35-
]
62+
],
63+
"execution_count": null,
64+
"outputs": []
3665
},
3766
{
3867
"cell_type": "markdown",
@@ -51,20 +80,20 @@
5180
"id": "IFva_Ed5N4ru"
5281
},
5382
"source": [
54-
"\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
55-
" \u003ctd\u003e\n",
56-
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/model_optimization/guide/clustering/clustering_comprehensive_guide\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
57-
" \u003c/td\u003e\n",
58-
" \u003ctd\u003e\n",
59-
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
60-
" \u003c/td\u003e\n",
61-
" \u003ctd\u003e\n",
62-
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView source on GitHub\u003c/a\u003e\n",
63-
" \u003c/td\u003e\n",
64-
" \u003ctd\u003e\n",
65-
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/model-optimization/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
66-
" \u003c/td\u003e\n",
67-
"\u003c/table\u003e"
83+
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
84+
" <td>\n",
85+
" <a target=\"_blank\" href=\"https://www.tensorflow.org/model_optimization/guide/clustering/clustering_comprehensive_guide\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
86+
" </td>\n",
87+
" <td>\n",
88+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
89+
" </td>\n",
90+
" <td>\n",
91+
" <a target=\"_blank\" href=\"https://github.com/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
92+
" </td>\n",
93+
" <td>\n",
94+
" <a href=\"https://storage.googleapis.com/tensorflow_docs/model-optimization/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
95+
" </td>\n",
96+
"</table>"
6897
]
6998
},
7099
{
@@ -101,14 +130,12 @@
101130
},
102131
{
103132
"cell_type": "code",
104-
"execution_count": null,
105133
"metadata": {
106-
"colab": {},
107134
"colab_type": "code",
108135
"id": "08dJRvOqN4rw",
109-
"scrolled": true
136+
"scrolled": true,
137+
"colab": {}
110138
},
111-
"outputs": [],
112139
"source": [
113140
"! pip install -q tensorflow-model-optimization\n",
114141
"\n",
@@ -176,7 +203,9 @@
176203
"\n",
177204
"setup_model()\n",
178205
"pretrained_weights = setup_pretrained_weights()"
179-
]
206+
],
207+
"execution_count": null,
208+
"outputs": []
180209
},
181210
{
182211
"cell_type": "markdown",
@@ -185,7 +214,7 @@
185214
"id": "ARd37qONN4rz"
186215
},
187216
"source": [
188-
"# Define a clustered model\n"
217+
"## Define a clustered model\n"
189218
]
190219
},
191220
{
@@ -215,14 +244,12 @@
215244
},
216245
{
217246
"cell_type": "code",
218-
"execution_count": null,
219247
"metadata": {
220-
"colab": {},
221248
"colab_type": "code",
222249
"id": "29g7OADjN4r1",
223-
"scrolled": true
250+
"scrolled": true,
251+
"colab": {}
224252
},
225-
"outputs": [],
226253
"source": [
227254
"import tensorflow_model_optimization as tfmot\n",
228255
"\n",
@@ -240,7 +267,9 @@
240267
"clustered_model = cluster_weights(model, **clustering_params)\n",
241268
"\n",
242269
"clustered_model.summary()"
243-
]
270+
],
271+
"execution_count": null,
272+
"outputs": []
244273
},
245274
{
246275
"cell_type": "markdown",
@@ -272,14 +301,12 @@
272301
},
273302
{
274303
"cell_type": "code",
275-
"execution_count": null,
276304
"metadata": {
277-
"colab": {},
278305
"colab_type": "code",
279306
"id": "IqBdl3uJN4r_",
280-
"scrolled": true
307+
"scrolled": true,
308+
"colab": {}
281309
},
282-
"outputs": [],
283310
"source": [
284311
"# Create a base model\n",
285312
"base_model = setup_model()\n",
@@ -300,7 +327,9 @@
300327
")\n",
301328
"\n",
302329
"clustered_model.summary()"
303-
]
330+
],
331+
"execution_count": null,
332+
"outputs": []
304333
},
305334
{
306335
"cell_type": "markdown",
@@ -309,7 +338,7 @@
309338
"id": "hN0DgpvD5Add"
310339
},
311340
"source": [
312-
"# Checkpoint and deserialize a clustered model"
341+
"## Checkpoint and deserialize a clustered model"
313342
]
314343
},
315344
{
@@ -324,13 +353,11 @@
324353
},
325354
{
326355
"cell_type": "code",
327-
"execution_count": null,
328356
"metadata": {
329-
"colab": {},
330357
"colab_type": "code",
331-
"id": "w7P67mPk6RkQ"
358+
"id": "w7P67mPk6RkQ",
359+
"colab": {}
332360
},
333-
"outputs": [],
334361
"source": [
335362
"# Define the model.\n",
336363
"base_model = setup_model()\n",
@@ -346,7 +373,9 @@
346373
" loaded_model = tf.keras.models.load_model(keras_model_file)\n",
347374
"\n",
348375
"loaded_model.summary()"
349-
]
376+
],
377+
"execution_count": null,
378+
"outputs": []
350379
},
351380
{
352381
"cell_type": "markdown",
@@ -355,7 +384,7 @@
355384
"id": "cUv-scK-N4sN"
356385
},
357386
"source": [
358-
"# Improve the accuracy of the clustered model"
387+
"## Improve the accuracy of the clustered model"
359388
]
360389
},
361390
{
@@ -381,7 +410,7 @@
381410
"id": "4DXw7YbyN4sP"
382411
},
383412
"source": [
384-
"# Deployment"
413+
"## Deployment"
385414
]
386415
},
387416
{
@@ -391,7 +420,7 @@
391420
"id": "5Y5zLfPzN4sQ"
392421
},
393422
"source": [
394-
"## Export model with size compression"
423+
"### Export model with size compression"
395424
]
396425
},
397426
{
@@ -406,13 +435,11 @@
406435
},
407436
{
408437
"cell_type": "code",
409-
"execution_count": null,
410438
"metadata": {
411-
"colab": {},
412439
"colab_type": "code",
413-
"id": "ZvuiCBsVN4sR"
440+
"id": "ZvuiCBsVN4sR",
441+
"colab": {}
414442
},
415-
"outputs": [],
416443
"source": [
417444
"model = setup_model()\n",
418445
"clustered_model = cluster_weights(model, **clustering_params)\n",
@@ -438,36 +465,9 @@
438465
" % (get_gzipped_model_size(clustered_model)))\n",
439466
"print(\"Size of gzipped clustered model with stripping: %.2f bytes\" \n",
440467
" % (get_gzipped_model_size(final_model)))"
441-
]
442-
}
443-
],
444-
"metadata": {
445-
"celltoolbar": "Raw Cell Format",
446-
"colab": {
447-
"collapsed_sections": [],
448-
"name": "clustering_comprehensive_guide.ipynb",
449-
"private_outputs": true,
450-
"provenance": [],
451-
"toc_visible": true
452-
},
453-
"kernelspec": {
454-
"display_name": "Python 3",
455-
"language": "python",
456-
"name": "python3"
457-
},
458-
"language_info": {
459-
"codemirror_mode": {
460-
"name": "ipython",
461-
"version": 3
462-
},
463-
"file_extension": ".py",
464-
"mimetype": "text/x-python",
465-
"name": "python",
466-
"nbconvert_exporter": "python",
467-
"pygments_lexer": "ipython3",
468-
"version": "3.6.9"
468+
],
469+
"execution_count": null,
470+
"outputs": []
469471
}
470-
},
471-
"nbformat": 4,
472-
"nbformat_minor": 0
472+
]
473473
}

0 commit comments

Comments
 (0)