"git@developer.sourcefind.cn:OpenDAS/megatron-lm.git" did not exist on "77bff3864ff8059718f0153eb65cf940a02ab2a8"
Unverified Commit 3d540429 authored by Mark Daoust's avatar Mark Daoust Committed by GitHub
Browse files

Merge pull request #4585 from MarkDaoust/no-string-activations

Remove string activations + typos.
parents dfd045e5 39f9e609
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
"colab": { "colab": {
"name": "basic_classification.ipynb", "name": "basic_classification.ipynb",
"version": "0.3.2", "version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [], "provenance": [],
"private_outputs": true, "private_outputs": true,
"collapsed_sections": [], "collapsed_sections": [],
...@@ -32,13 +30,7 @@ ...@@ -32,13 +30,7 @@
"metadata": { "metadata": {
"id": "_ckMIh7O7s6D", "id": "_ckMIh7O7s6D",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -61,13 +53,7 @@ ...@@ -61,13 +53,7 @@
"metadata": { "metadata": {
"id": "vasWnqRgy1H4", "id": "vasWnqRgy1H4",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -114,10 +100,10 @@ ...@@ -114,10 +100,10 @@
"cell_type": "markdown", "cell_type": "markdown",
"source": [ "source": [
"<table align=\"left\"><td>\n", "<table align=\"left\"><td>\n",
"<a target=\"_blank\" href=\"https://colab.sandbox.google.com/github/tensorflow/models/blob/master/samples/core/get_started/basic-classification.ipynb\">\n", "<a target=\"_blank\" href=\"https://colab.sandbox.google.com/github/tensorflow/models/blob/master/samples/core/get_started/basic_classification.ipynb\">\n",
" <img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a> \n", " <img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a> \n",
"</td><td>\n", "</td><td>\n",
"<a target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/samples/core/get_started/basic-classification.ipynb\"><img width=32px src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on Github</a></td></table>\n" "<a target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/samples/core/get_started/basic_classification.ipynb\"><img width=32px src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on Github</a></td></table>\n"
] ]
}, },
{ {
...@@ -136,12 +122,7 @@ ...@@ -136,12 +122,7 @@
"metadata": { "metadata": {
"id": "dzLKpmZICaWN", "id": "dzLKpmZICaWN",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -198,12 +179,7 @@ ...@@ -198,12 +179,7 @@
"metadata": { "metadata": {
"id": "7MqDQO0KCaWS", "id": "7MqDQO0KCaWS",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -282,12 +258,7 @@ ...@@ -282,12 +258,7 @@
"metadata": { "metadata": {
"id": "IjnLH5S2CaWx", "id": "IjnLH5S2CaWx",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -313,12 +284,7 @@ ...@@ -313,12 +284,7 @@
"metadata": { "metadata": {
"id": "zW5k_xz1CaWX", "id": "zW5k_xz1CaWX",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -341,12 +307,7 @@ ...@@ -341,12 +307,7 @@
"metadata": { "metadata": {
"id": "TRFYHB2mCaWb", "id": "TRFYHB2mCaWb",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -369,12 +330,7 @@ ...@@ -369,12 +330,7 @@
"metadata": { "metadata": {
"id": "XKnCTHz4CaWg", "id": "XKnCTHz4CaWg",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -397,12 +353,7 @@ ...@@ -397,12 +353,7 @@
"metadata": { "metadata": {
"id": "2KFnYlcwCaWl", "id": "2KFnYlcwCaWl",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -425,12 +376,7 @@ ...@@ -425,12 +376,7 @@
"metadata": { "metadata": {
"id": "iJmPr5-ACaWn", "id": "iJmPr5-ACaWn",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -455,12 +401,7 @@ ...@@ -455,12 +401,7 @@
"metadata": { "metadata": {
"id": "m4VEw8Ud9Quh", "id": "m4VEw8Ud9Quh",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -486,12 +427,7 @@ ...@@ -486,12 +427,7 @@
"metadata": { "metadata": {
"id": "DSD9qKcqCaWs", "id": "DSD9qKcqCaWs",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -517,12 +453,7 @@ ...@@ -517,12 +453,7 @@
"metadata": { "metadata": {
"id": "bW5WzIPlCaWv", "id": "bW5WzIPlCaWv",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -547,12 +478,7 @@ ...@@ -547,12 +478,7 @@
"metadata": { "metadata": {
"id": "oZTImqg_CaW1", "id": "oZTImqg_CaW1",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -601,19 +527,14 @@ ...@@ -601,19 +527,14 @@
"metadata": { "metadata": {
"id": "9ODch-OFCaW4", "id": "9ODch-OFCaW4",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"model = keras.Sequential([\n", "model = keras.Sequential([\n",
" keras.layers.Flatten(input_shape=(28, 28)),\n", " keras.layers.Flatten(input_shape=(28, 28)),\n",
" keras.layers.Dense(128, activation='relu'),\n", " keras.layers.Dense(128, activation=tf.nn.relu),\n",
" keras.layers.Dense(10, activation='softmax')\n", " keras.layers.Dense(10, activation=tf.nn.softmax)\n",
"])" "])"
], ],
"execution_count": 0, "execution_count": 0,
...@@ -643,12 +564,7 @@ ...@@ -643,12 +564,7 @@
"metadata": { "metadata": {
"id": "Lhan11blCaW7", "id": "Lhan11blCaW7",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -681,12 +597,7 @@ ...@@ -681,12 +597,7 @@
"metadata": { "metadata": {
"id": "xvwvpA64CaW_", "id": "xvwvpA64CaW_",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -721,12 +632,7 @@ ...@@ -721,12 +632,7 @@
"metadata": { "metadata": {
"id": "VflXLEeECaXC", "id": "VflXLEeECaXC",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -763,12 +669,7 @@ ...@@ -763,12 +669,7 @@
"metadata": { "metadata": {
"id": "Gl91RPhdCaXI", "id": "Gl91RPhdCaXI",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -791,12 +692,7 @@ ...@@ -791,12 +692,7 @@
"metadata": { "metadata": {
"id": "3DmJEUinCaXK", "id": "3DmJEUinCaXK",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -819,12 +715,7 @@ ...@@ -819,12 +715,7 @@
"metadata": { "metadata": {
"id": "qsqenuPnCaXO", "id": "qsqenuPnCaXO",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -847,12 +738,7 @@ ...@@ -847,12 +738,7 @@
"metadata": { "metadata": {
"id": "Sd7Pgsu6CaXP", "id": "Sd7Pgsu6CaXP",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -875,12 +761,7 @@ ...@@ -875,12 +761,7 @@
"metadata": { "metadata": {
"id": "YGBDAiziCaXR", "id": "YGBDAiziCaXR",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -921,12 +802,7 @@ ...@@ -921,12 +802,7 @@
"metadata": { "metadata": {
"id": "yRJ7JU7JCaXT", "id": "yRJ7JU7JCaXT",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -952,12 +828,7 @@ ...@@ -952,12 +828,7 @@
"metadata": { "metadata": {
"id": "lDFh5yF_CaXW", "id": "lDFh5yF_CaXW",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -983,12 +854,7 @@ ...@@ -983,12 +854,7 @@
"metadata": { "metadata": {
"id": "o_rzNSdrCaXY", "id": "o_rzNSdrCaXY",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1013,12 +879,7 @@ ...@@ -1013,12 +879,7 @@
"metadata": { "metadata": {
"id": "2tRmdq_8CaXb", "id": "2tRmdq_8CaXb",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1038,6 +899,19 @@ ...@@ -1038,6 +899,19 @@
"source": [ "source": [
"And, as before, the model predicts a label of 9." "And, as before, the model predicts a label of 9."
] ]
},
{
"metadata": {
"id": "fzHAx2M99WCd",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
"execution_count": 0,
"outputs": []
} }
] ]
} }
\ No newline at end of file
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
"colab": { "colab": {
"name": "basic-regression.ipynb", "name": "basic-regression.ipynb",
"version": "0.3.2", "version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [], "provenance": [],
"private_outputs": true, "private_outputs": true,
"collapsed_sections": [ "collapsed_sections": [
...@@ -34,13 +32,7 @@ ...@@ -34,13 +32,7 @@
"metadata": { "metadata": {
"id": "AwOEIRJC6Une", "id": "AwOEIRJC6Une",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -63,13 +55,7 @@ ...@@ -63,13 +55,7 @@
"metadata": { "metadata": {
"id": "KyPEtTqk6VdG", "id": "KyPEtTqk6VdG",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -141,12 +127,7 @@ ...@@ -141,12 +127,7 @@
"metadata": { "metadata": {
"id": "1rRo8oNqZ-Rj", "id": "1rRo8oNqZ-Rj",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -176,12 +157,7 @@ ...@@ -176,12 +157,7 @@
"metadata": { "metadata": {
"id": "p9kxxgzvzlyz", "id": "p9kxxgzvzlyz",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -213,12 +189,7 @@ ...@@ -213,12 +189,7 @@
"metadata": { "metadata": {
"id": "Ujqcgkipr65P", "id": "Ujqcgkipr65P",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -258,12 +229,7 @@ ...@@ -258,12 +229,7 @@
"metadata": { "metadata": {
"id": "8tYsm8Gs03J4", "id": "8tYsm8Gs03J4",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -286,12 +252,7 @@ ...@@ -286,12 +252,7 @@
"metadata": { "metadata": {
"id": "pYVyGhdyCpIM", "id": "pYVyGhdyCpIM",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -322,12 +283,7 @@ ...@@ -322,12 +283,7 @@
"metadata": { "metadata": {
"id": "I8NwI2ND2t4Y", "id": "I8NwI2ND2t4Y",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -352,12 +308,7 @@ ...@@ -352,12 +308,7 @@
"metadata": { "metadata": {
"id": "ze5WQP8R1TYg", "id": "ze5WQP8R1TYg",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -399,22 +350,17 @@ ...@@ -399,22 +350,17 @@
"metadata": { "metadata": {
"id": "c26juK7ZG8j-", "id": "c26juK7ZG8j-",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"def build_model():\n", "def build_model():\n",
" model = keras.Sequential()\n", " model = keras.Sequential([\n",
" \n", " keras.layers.Dense(64, activation=tf.nn.relu, \n",
" model.add(keras.layers.Dense(64, activation=tf.nn.relu,\n", " input_shape=(train_data.shape[1],)),\n",
" input_shape=(train_data.shape[1],)))\n", " keras.layers.Dense(64, activation=tf.nn.relu),\n",
" model.add(keras.layers.Dense(64, activation=tf.nn.relu))\n", " keras.layers.Dense(1)\n",
" model.add(keras.layers.Dense(1))\n", " ])\n",
"\n", "\n",
" optimizer = tf.train.RMSPropOptimizer(0.001)\n", " optimizer = tf.train.RMSPropOptimizer(0.001)\n",
"\n", "\n",
...@@ -445,12 +391,7 @@ ...@@ -445,12 +391,7 @@
"metadata": { "metadata": {
"id": "sD7qHCmNIOY0", "id": "sD7qHCmNIOY0",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -484,12 +425,7 @@ ...@@ -484,12 +425,7 @@
"metadata": { "metadata": {
"id": "B6XriGbVPh2t", "id": "B6XriGbVPh2t",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -500,8 +436,10 @@ ...@@ -500,8 +436,10 @@
" plt.figure()\n", " plt.figure()\n",
" plt.xlabel('Epoch')\n", " plt.xlabel('Epoch')\n",
" plt.ylabel('Mean Abs Error [1000$]')\n", " plt.ylabel('Mean Abs Error [1000$]')\n",
" plt.plot(history.epoch, np.array(history.history['mean_absolute_error']), label='Train Loss')\n", " plt.plot(history.epoch, np.array(history.history['mean_absolute_error']), \n",
" plt.plot(history.epoch, np.array(history.history['val_mean_absolute_error']), label = 'Val loss')\n", " label='Train Loss')\n",
" plt.plot(history.epoch, np.array(history.history['val_mean_absolute_error']),\n",
" label = 'Val loss')\n",
" plt.legend()\n", " plt.legend()\n",
" plt.ylim([0,5])\n", " plt.ylim([0,5])\n",
"\n", "\n",
...@@ -526,12 +464,7 @@ ...@@ -526,12 +464,7 @@
"metadata": { "metadata": {
"id": "fdMZuhUgzMZ4", "id": "fdMZuhUgzMZ4",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -565,12 +498,7 @@ ...@@ -565,12 +498,7 @@
"metadata": { "metadata": {
"id": "jl_yNr5n1kms", "id": "jl_yNr5n1kms",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -597,12 +525,7 @@ ...@@ -597,12 +525,7 @@
"metadata": { "metadata": {
"id": "Xe7RXH3N3CWU", "id": "Xe7RXH3N3CWU",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -622,7 +545,7 @@ ...@@ -622,7 +545,7 @@
"source": [ "source": [
"## Conclusion\n", "## Conclusion\n",
"\n", "\n",
"This notebook i a few techniques to introduce a regresson problem.\n", "This notebook introduced a few techniques to handle a regresson problem.\n",
"\n", "\n",
"* Mean Squared Error (MSE) is a common loss function used for regression problems (different than classification problems).\n", "* Mean Squared Error (MSE) is a common loss function used for regression problems (different than classification problems).\n",
"* Similarly, evaluation metrics used for regression differ from classification. A common regression metric is Mean Absolute Error (MAE).\n", "* Similarly, evaluation metrics used for regression differ from classification. A common regression metric is Mean Absolute Error (MAE).\n",
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
"colab": { "colab": {
"name": "basic-text-classification.ipynb", "name": "basic-text-classification.ipynb",
"version": "0.3.2", "version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [], "provenance": [],
"private_outputs": true, "private_outputs": true,
"collapsed_sections": [], "collapsed_sections": [],
...@@ -32,13 +30,7 @@ ...@@ -32,13 +30,7 @@
"metadata": { "metadata": {
"id": "ioaprt5q5US7", "id": "ioaprt5q5US7",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -61,13 +53,7 @@ ...@@ -61,13 +53,7 @@
"metadata": { "metadata": {
"id": "yCl0eTNH5RS3", "id": "yCl0eTNH5RS3",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -139,12 +125,7 @@ ...@@ -139,12 +125,7 @@
"metadata": { "metadata": {
"id": "2ew7HTbPpCJH", "id": "2ew7HTbPpCJH",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -176,12 +157,7 @@ ...@@ -176,12 +157,7 @@
"metadata": { "metadata": {
"id": "zXXx5Oc3pOmN", "id": "zXXx5Oc3pOmN",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -218,12 +194,7 @@ ...@@ -218,12 +194,7 @@
"metadata": { "metadata": {
"id": "y8qCnve_-lkO", "id": "y8qCnve_-lkO",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -246,12 +217,7 @@ ...@@ -246,12 +217,7 @@
"metadata": { "metadata": {
"id": "QtTS4kpEpjbi", "id": "QtTS4kpEpjbi",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -274,12 +240,7 @@ ...@@ -274,12 +240,7 @@
"metadata": { "metadata": {
"id": "X-6Ii9Pfx6Nr", "id": "X-6Ii9Pfx6Nr",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -304,12 +265,7 @@ ...@@ -304,12 +265,7 @@
"metadata": { "metadata": {
"id": "tr5s_1alpzop", "id": "tr5s_1alpzop",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -345,12 +301,7 @@ ...@@ -345,12 +301,7 @@
"metadata": { "metadata": {
"id": "s_OqxmH6-lkn", "id": "s_OqxmH6-lkn",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -383,12 +334,7 @@ ...@@ -383,12 +334,7 @@
"metadata": { "metadata": {
"id": "2jQv-omsHurp", "id": "2jQv-omsHurp",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -419,12 +365,7 @@ ...@@ -419,12 +365,7 @@
"metadata": { "metadata": {
"id": "USSSBnkE-lky", "id": "USSSBnkE-lky",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -447,12 +388,7 @@ ...@@ -447,12 +388,7 @@
"metadata": { "metadata": {
"id": "TG8X9cqi-lk9", "id": "TG8X9cqi-lk9",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -482,12 +418,7 @@ ...@@ -482,12 +418,7 @@
"metadata": { "metadata": {
"id": "xpKOoWgu-llD", "id": "xpKOoWgu-llD",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -497,8 +428,8 @@ ...@@ -497,8 +428,8 @@
"model = keras.Sequential()\n", "model = keras.Sequential()\n",
"model.add(keras.layers.Embedding(vocab_size, 16))\n", "model.add(keras.layers.Embedding(vocab_size, 16))\n",
"model.add(keras.layers.GlobalAveragePooling1D())\n", "model.add(keras.layers.GlobalAveragePooling1D())\n",
"model.add(keras.layers.Dense(16, activation='relu'))\n", "model.add(keras.layers.Dense(16, activation=tf.nn.relu))\n",
"model.add(keras.layers.Dense(1, activation='sigmoid'))\n", "model.add(keras.layers.Dense(1, activation=tf.nn.sigmoid))\n",
"\n", "\n",
"model.summary()" "model.summary()"
], ],
...@@ -556,16 +487,11 @@ ...@@ -556,16 +487,11 @@
"metadata": { "metadata": {
"id": "Mr0GP-cQ-llN", "id": "Mr0GP-cQ-llN",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"model.compile(optimizer='adam',\n", "model.compile(optimizer=tf.train.AdamOptimizer(),\n",
" loss='binary_crossentropy',\n", " loss='binary_crossentropy',\n",
" metrics=['accuracy'])" " metrics=['accuracy'])"
], ],
...@@ -588,12 +514,7 @@ ...@@ -588,12 +514,7 @@
"metadata": { "metadata": {
"id": "-NpcXY9--llS", "id": "-NpcXY9--llS",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -622,12 +543,7 @@ ...@@ -622,12 +543,7 @@
"metadata": { "metadata": {
"id": "tXSGrjWZ-llW", "id": "tXSGrjWZ-llW",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -657,12 +573,7 @@ ...@@ -657,12 +573,7 @@
"metadata": { "metadata": {
"id": "zOMKywn4zReN", "id": "zOMKywn4zReN",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -699,12 +610,7 @@ ...@@ -699,12 +610,7 @@
"metadata": { "metadata": {
"id": "VcvSXvhp-llb", "id": "VcvSXvhp-llb",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -728,12 +634,7 @@ ...@@ -728,12 +634,7 @@
"metadata": { "metadata": {
"id": "nGoYf2Js-lle", "id": "nGoYf2Js-lle",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -764,12 +665,7 @@ ...@@ -764,12 +665,7 @@
"metadata": { "metadata": {
"id": "6hXx-xOv-llh", "id": "6hXx-xOv-llh",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
"colab": { "colab": {
"name": "custom-training-walkthrough.ipynb", "name": "custom-training-walkthrough.ipynb",
"version": "0.3.2", "version": "0.3.2",
"views": {},
"default_view": {},
"provenance": [], "provenance": [],
"private_outputs": true, "private_outputs": true,
"collapsed_sections": [], "collapsed_sections": [],
...@@ -34,13 +32,7 @@ ...@@ -34,13 +32,7 @@
"metadata": { "metadata": {
"id": "CPII1rGR2rF9", "id": "CPII1rGR2rF9",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
},
"cellView": "form"
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -145,12 +137,7 @@ ...@@ -145,12 +137,7 @@
"metadata": { "metadata": {
"id": "jBmKxLVy9Uhg", "id": "jBmKxLVy9Uhg",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -177,12 +164,7 @@ ...@@ -177,12 +164,7 @@
"metadata": { "metadata": {
"id": "g4Wzg69bnwK2", "id": "g4Wzg69bnwK2",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -252,12 +234,7 @@ ...@@ -252,12 +234,7 @@
"metadata": { "metadata": {
"id": "J6c7uEU9rjRM", "id": "J6c7uEU9rjRM",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -287,12 +264,7 @@ ...@@ -287,12 +264,7 @@
"metadata": { "metadata": {
"id": "FQvb_JYdrpPm", "id": "FQvb_JYdrpPm",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -323,12 +295,7 @@ ...@@ -323,12 +295,7 @@
"metadata": { "metadata": {
"id": "9Edhevw7exl6", "id": "9Edhevw7exl6",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -364,12 +331,7 @@ ...@@ -364,12 +331,7 @@
"metadata": { "metadata": {
"id": "sVNlJlUOhkoX", "id": "sVNlJlUOhkoX",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -397,12 +359,7 @@ ...@@ -397,12 +359,7 @@
"metadata": { "metadata": {
"id": "WsxHnz1ebJ2S", "id": "WsxHnz1ebJ2S",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -434,12 +391,7 @@ ...@@ -434,12 +391,7 @@
"metadata": { "metadata": {
"id": "iDuG94H-C122", "id": "iDuG94H-C122",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -466,12 +418,7 @@ ...@@ -466,12 +418,7 @@
"metadata": { "metadata": {
"id": "me5Wn-9FcyyO", "id": "me5Wn-9FcyyO",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -502,12 +449,7 @@ ...@@ -502,12 +449,7 @@
"metadata": { "metadata": {
"id": "jm932WINcaGU", "id": "jm932WINcaGU",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -533,12 +475,7 @@ ...@@ -533,12 +475,7 @@
"metadata": { "metadata": {
"id": "ZbDkzGZIkpXf", "id": "ZbDkzGZIkpXf",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -561,12 +498,7 @@ ...@@ -561,12 +498,7 @@
"metadata": { "metadata": {
"id": "kex9ibEek6Tr", "id": "kex9ibEek6Tr",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -627,18 +559,13 @@ ...@@ -627,18 +559,13 @@
"metadata": { "metadata": {
"id": "2fZ6oL2ig3ZK", "id": "2fZ6oL2ig3ZK",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"model = tf.keras.Sequential([\n", "model = tf.keras.Sequential([\n",
" tf.keras.layers.Dense(10, activation=\"relu\", input_shape=(4,)), # input shape required\n", " tf.keras.layers.Dense(10, activation=tf.nn.relu, input_shape=(4,)), # input shape required\n",
" tf.keras.layers.Dense(10, activation=\"relu\"),\n", " tf.keras.layers.Dense(10, activation=tf.nn.relu),\n",
" tf.keras.layers.Dense(3)\n", " tf.keras.layers.Dense(3)\n",
"])" "])"
], ],
...@@ -673,12 +600,7 @@ ...@@ -673,12 +600,7 @@
"metadata": { "metadata": {
"id": "xe6SQ5NrpB-I", "id": "xe6SQ5NrpB-I",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -704,12 +626,7 @@ ...@@ -704,12 +626,7 @@
"metadata": { "metadata": {
"id": "_tRwHZmTNTX2", "id": "_tRwHZmTNTX2",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -732,12 +649,7 @@ ...@@ -732,12 +649,7 @@
"metadata": { "metadata": {
"id": "-Jzm_GoErz8B", "id": "-Jzm_GoErz8B",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -779,12 +691,7 @@ ...@@ -779,12 +691,7 @@
"metadata": { "metadata": {
"id": "tMAT4DcMPwI-", "id": "tMAT4DcMPwI-",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -813,12 +720,7 @@ ...@@ -813,12 +720,7 @@
"metadata": { "metadata": {
"id": "x57HcKWhKkei", "id": "x57HcKWhKkei",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -868,12 +770,7 @@ ...@@ -868,12 +770,7 @@
"metadata": { "metadata": {
"id": "8xxi2NNGKwG_", "id": "8xxi2NNGKwG_",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -898,12 +795,7 @@ ...@@ -898,12 +795,7 @@
"metadata": { "metadata": {
"id": "rxRNTFVe56RG", "id": "rxRNTFVe56RG",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -945,12 +837,7 @@ ...@@ -945,12 +837,7 @@
"metadata": { "metadata": {
"id": "AIgulGRUhpto", "id": "AIgulGRUhpto",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1016,12 +903,7 @@ ...@@ -1016,12 +903,7 @@
"metadata": { "metadata": {
"id": "agjvNd2iUGFn", "id": "agjvNd2iUGFn",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1101,12 +983,7 @@ ...@@ -1101,12 +983,7 @@
"metadata": { "metadata": {
"id": "Ps3_9dJ3Lodk", "id": "Ps3_9dJ3Lodk",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1122,12 +999,7 @@ ...@@ -1122,12 +999,7 @@
"metadata": { "metadata": {
"id": "SRMWCu30bnxH", "id": "SRMWCu30bnxH",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1160,12 +1032,7 @@ ...@@ -1160,12 +1032,7 @@
"metadata": { "metadata": {
"id": "Tw03-MK1cYId", "id": "Tw03-MK1cYId",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1195,12 +1062,7 @@ ...@@ -1195,12 +1062,7 @@
"metadata": { "metadata": {
"id": "uNwt2eMeOane", "id": "uNwt2eMeOane",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1231,12 +1093,7 @@ ...@@ -1231,12 +1093,7 @@
"metadata": { "metadata": {
"id": "kesTS5Lzv-M2", "id": "kesTS5Lzv-M2",
"colab_type": "code", "colab_type": "code",
"colab": { "colab": {}
"autoexec": {
"startup": false,
"wait_interval": 0
}
}
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
...@@ -1282,4 +1139,4 @@ ...@@ -1282,4 +1139,4 @@
] ]
} }
] ]
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment