From 32f2dcda776cd17cc9ea35df86e8ab0387134e70 Mon Sep 17 00:00:00 2001 From: Ruomei Yan Date: Sun, 9 Aug 2020 10:25:52 +0100 Subject: [PATCH] Fix incorrect header sizes in the clustering comprehensive guide --- .../clustering_comprehensive_guide.ipynb | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) mode change 100755 => 100644 tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb diff --git a/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb b/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb old mode 100755 new mode 100644 index 7925f54f4..fdee905bf --- a/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb +++ b/tensorflow_model_optimization/g3doc/guide/clustering/clustering_comprehensive_guide.ipynb @@ -1,4 +1,33 @@ { + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "celltoolbar": "Raw Cell Format", + "colab": { + "name": "clustering_comprehensive_guide.ipynb", + "provenance": [], + "private_outputs": true, + "collapsed_sections": [], + "toc_visible": true + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + } + }, "cells": [ { "cell_type": "markdown", @@ -7,19 +36,17 @@ "id": "826IBSWMN4rr" }, "source": [ - "**Copyright 2020 The TensorFlow Authors.**" + "##### Copyright 2020 The TensorFlow Authors." ] }, { "cell_type": "code", - "execution_count": null, "metadata": { "cellView": "form", - "colab": {}, "colab_type": "code", - "id": "ITj3u97-tNR7" + "id": "ITj3u97-tNR7", + "colab": {} }, - "outputs": [], "source": [ "#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -32,7 +59,9 @@ "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", "# See the License for the specific language governing permissions and\n", "# limitations under the License." - ] + ], + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -51,20 +80,20 @@ "id": "IFva_Ed5N4ru" }, "source": [ - "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n", - " \u003ctd\u003e\n", - " \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", - " \u003c/td\u003e\n", - " \u003ctd\u003e\n", - " \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", - " \u003c/td\u003e\n", - " \u003ctd\u003e\n", - " \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", - " \u003c/td\u003e\n", - " \u003ctd\u003e\n", - " \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", - " \u003c/td\u003e\n", - "\u003c/table\u003e" + "\n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " View on TensorFlow.org\n", + " \n", + " Run in Google Colab\n", + " \n", + " View source on GitHub\n", + " \n", + " Download notebook\n", + "
" ] }, { @@ -101,14 +130,12 @@ }, { "cell_type": "code", - "execution_count": null, "metadata": { - "colab": {}, "colab_type": "code", "id": "08dJRvOqN4rw", - "scrolled": true + "scrolled": true, + "colab": {} }, - "outputs": [], "source": [ "! pip install -q tensorflow-model-optimization\n", "\n", @@ -176,7 +203,9 @@ "\n", "setup_model()\n", "pretrained_weights = setup_pretrained_weights()" - ] + ], + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -185,7 +214,7 @@ "id": "ARd37qONN4rz" }, "source": [ - "# Define a clustered model\n" + "## Define a clustered model\n" ] }, { @@ -215,14 +244,12 @@ }, { "cell_type": "code", - "execution_count": null, "metadata": { - "colab": {}, "colab_type": "code", "id": "29g7OADjN4r1", - "scrolled": true + "scrolled": true, + "colab": {} }, - "outputs": [], "source": [ "import tensorflow_model_optimization as tfmot\n", "\n", @@ -240,7 +267,9 @@ "clustered_model = cluster_weights(model, **clustering_params)\n", "\n", "clustered_model.summary()" - ] + ], + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -272,14 +301,12 @@ }, { "cell_type": "code", - "execution_count": null, "metadata": { - "colab": {}, "colab_type": "code", "id": "IqBdl3uJN4r_", - "scrolled": true + "scrolled": true, + "colab": {} }, - "outputs": [], "source": [ "# Create a base model\n", "base_model = setup_model()\n", @@ -300,7 +327,9 @@ ")\n", "\n", "clustered_model.summary()" - ] + ], + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -309,7 +338,7 @@ "id": "hN0DgpvD5Add" }, "source": [ - "# Checkpoint and deserialize a clustered model" + "## Checkpoint and deserialize a clustered model" ] }, { @@ -324,13 +353,11 @@ }, { "cell_type": "code", - "execution_count": null, "metadata": { - "colab": {}, "colab_type": "code", - "id": "w7P67mPk6RkQ" + "id": "w7P67mPk6RkQ", + "colab": {} }, - "outputs": [], "source": [ "# Define the model.\n", "base_model = setup_model()\n", @@ -346,7 +373,9 @@ " loaded_model = tf.keras.models.load_model(keras_model_file)\n", "\n", "loaded_model.summary()" - ] + ], + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -355,7 +384,7 @@ "id": "cUv-scK-N4sN" }, "source": [ - "# Improve the accuracy of the clustered model" + "## Improve the accuracy of the clustered model" ] }, { @@ -381,7 +410,7 @@ "id": "4DXw7YbyN4sP" }, "source": [ - "# Deployment" + "## Deployment" ] }, { @@ -391,7 +420,7 @@ "id": "5Y5zLfPzN4sQ" }, "source": [ - "## Export model with size compression" + "### Export model with size compression" ] }, { @@ -406,13 +435,11 @@ }, { "cell_type": "code", - "execution_count": null, "metadata": { - "colab": {}, "colab_type": "code", - "id": "ZvuiCBsVN4sR" + "id": "ZvuiCBsVN4sR", + "colab": {} }, - "outputs": [], "source": [ "model = setup_model()\n", "clustered_model = cluster_weights(model, **clustering_params)\n", @@ -438,36 +465,9 @@ " % (get_gzipped_model_size(clustered_model)))\n", "print(\"Size of gzipped clustered model with stripping: %.2f bytes\" \n", " % (get_gzipped_model_size(final_model)))" - ] - } - ], - "metadata": { - "celltoolbar": "Raw Cell Format", - "colab": { - "collapsed_sections": [], - "name": "clustering_comprehensive_guide.ipynb", - "private_outputs": true, - "provenance": [], - "toc_visible": true - }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.9" + ], + "execution_count": null, + "outputs": [] } - }, - "nbformat": 4, - "nbformat_minor": 0 + ] }