|
51 | 51 | "id": "wfqlePz0g6o5" |
52 | 52 | }, |
53 | 53 | "source": [ |
54 | | - "<table class=\"tfo-notebook-buttons\" align=\"left\">\n", |
55 | | - " <td>\n", |
56 | | - " <a target=\"_blank\" href=\"https://www.tensorflow.org/neural_structured_learning/tutorials/adversarial_keras_cnn_mnist\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n", |
57 | | - " </td>\n", |
58 | | - " <td>\n", |
59 | | - " <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/neural-structured-learning/blob/master/g3doc/tutorials/adversarial_keras_cnn_mnist.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n", |
60 | | - " </td>\n", |
61 | | - " <td>\n", |
62 | | - " <a target=\"_blank\" href=\"https://github.com/tensorflow/neural-structured-learning/blob/master/g3doc/tutorials/adversarial_keras_cnn_mnist.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n", |
63 | | - " </td>\n", |
64 | | - "</table>" |
| 54 | + "\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n", |
| 55 | + " \u003ctd\u003e\n", |
| 56 | + " \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/neural_structured_learning/tutorials/adversarial_keras_cnn_mnist\"\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/neural-structured-learning/blob/master/g3doc/tutorials/adversarial_keras_cnn_mnist.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/neural-structured-learning/blob/master/g3doc/tutorials/adversarial_keras_cnn_mnist.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 | + "\u003c/table\u003e" |
65 | 65 | ] |
66 | 66 | }, |
67 | 67 | { |
|
115 | 115 | "id": "m58k8nv3YVdf" |
116 | 116 | }, |
117 | 117 | "source": [ |
118 | | - "Install Tensorflow 2.0 to create an interactive developing environment with\n", |
| 118 | + "Select TensorFlow 2.x to create an interactive development environment with\n", |
119 | 119 | "eager execution." |
120 | 120 | ] |
121 | 121 | }, |
|
129 | 129 | }, |
130 | 130 | "outputs": [], |
131 | 131 | "source": [ |
132 | | - "!pip install tensorflow-gpu==2.0.0-rc0" |
| 132 | + "try:\n", |
| 133 | + " # %tensorflow_version only exists in Colab.\n", |
| 134 | + " %tensorflow_version 2.x\n", |
| 135 | + "except Exception:\n", |
| 136 | + " !pip install --quiet tensorflow-gpu>=2.0.0" |
133 | 137 | ] |
134 | 138 | }, |
135 | 139 | { |
|
376 | 380 | " x = tf.keras.layers.Conv2D(\n", |
377 | 381 | " num_filters, hparams.kernel_size, activation='relu')(\n", |
378 | 382 | " x)\n", |
379 | | - " if i < len(hparams.conv_filters) - 1:\n", |
| 383 | + " if i \u003c len(hparams.conv_filters) - 1:\n", |
380 | 384 | " # max pooling between convolutional layers\n", |
381 | 385 | " x = tf.keras.layers.MaxPooling2D(hparams.pool_size)(x)\n", |
382 | 386 | " x = tf.keras.layers.Flatten()(x)\n", |
|
800 | 804 | "timestamp": 1566174674305 |
801 | 805 | } |
802 | 806 | ], |
803 | | - "toc_visible": true, |
804 | | - "version": "0.3.2" |
| 807 | + "toc_visible": true |
805 | 808 | }, |
806 | 809 | "kernelspec": { |
807 | | - "display_name": "Python 3", |
808 | | - "language": "python", |
809 | | - "name": "python3" |
810 | | - }, |
811 | | - "language_info": { |
812 | | - "codemirror_mode": { |
813 | | - "name": "ipython", |
814 | | - "version": 3 |
815 | | - }, |
816 | | - "file_extension": ".py", |
817 | | - "mimetype": "text/x-python", |
818 | | - "name": "python", |
819 | | - "nbconvert_exporter": "python", |
820 | | - "pygments_lexer": "ipython3", |
821 | | - "version": "3.7.3" |
| 810 | + "display_name": "Python 2", |
| 811 | + "name": "python2" |
822 | 812 | } |
823 | 813 | }, |
824 | 814 | "nbformat": 4, |
|
0 commit comments