Skip to content

Commit eab8dea

Browse files
authored
fix imports and layer naming (#2129)
1 parent 1fa4d2b commit eab8dea

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

docs/tutorials/average_optimizers_callback.ipynb

+6-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@
106106
{
107107
"cell_type": "code",
108108
"execution_count": null,
109-
"metadata": {},
109+
"metadata": {
110+
"scrolled": true
111+
},
110112
"outputs": [],
111113
"source": [
112114
"!pip install -U tensorflow-addons"
@@ -167,8 +169,8 @@
167169
"def create_model(opt):\n",
168170
" model = tf.keras.models.Sequential([\n",
169171
" tf.keras.layers.Flatten(), \n",
170-
" tf.keras.layers.Dense(64, activation='relu', name='dense_1'),\n",
171-
" tf.keras.layers.Dense(64, activation='relu', name='dense_2'),\n",
172+
" tf.keras.layers.Dense(64, activation='relu'),\n",
173+
" tf.keras.layers.Dense(64, activation='relu'),\n",
172174
" tf.keras.layers.Dense(10, activation='softmax')\n",
173175
" ])\n",
174176
"\n",
@@ -454,6 +456,7 @@
454456
},
455457
"kernelspec": {
456458
"display_name": "Python 3",
459+
"language": "python",
457460
"name": "python3"
458461
}
459462
},

docs/tutorials/networks_seq2seq_nmt.ipynb

+15-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"metadata": {
77
"colab": {},
88
"colab_type": "code",
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"cell_type": "code",
18-
"execution_count": 2,
18+
"execution_count": null,
1919
"metadata": {
2020
"cellView": "form",
2121
"colab": {},
@@ -116,7 +116,8 @@
116116
"metadata": {},
117117
"outputs": [],
118118
"source": [
119-
"!pip install -U tensorflow-addons"
119+
"!pip install -U tensorflow-addons\n",
120+
"!pip install nltk sklearn"
120121
]
121122
},
122123
{
@@ -132,7 +133,7 @@
132133
"#download data\n",
133134
"print(\"Downloading Dataset:\")\n",
134135
"!wget --quiet http://www.manythings.org/anki/deu-eng.zip\n",
135-
"!unzip deu-eng.zip"
136+
"!unzip -o deu-eng.zip"
136137
]
137138
},
138139
{
@@ -159,15 +160,15 @@
159160
"import itertools\n",
160161
"from pickle import load\n",
161162
"from tensorflow.keras.utils import to_categorical\n",
162-
"from keras.utils.vis_utils import plot_model\n",
163+
"from tensorflow.keras.utils import plot_model\n",
163164
"from tensorflow.keras.models import Sequential\n",
164165
"from tensorflow.keras.layers import LSTM\n",
165166
"from tensorflow.keras.layers import Dense\n",
166167
"from tensorflow.keras.layers import Embedding\n",
167168
"from pickle import load\n",
168169
"import random\n",
169170
"import tensorflow as tf\n",
170-
"from keras.models import load_model\n",
171+
"from tensorflow.keras.models import load_model\n",
171172
"from nltk.translate.bleu_score import corpus_bleu\n",
172173
"from sklearn.model_selection import train_test_split\n",
173174
"import tensorflow_addons as tfa"
@@ -187,7 +188,7 @@
187188
},
188189
{
189190
"cell_type": "code",
190-
"execution_count": 2,
191+
"execution_count": null,
191192
"metadata": {
192193
"colab": {},
193194
"colab_type": "code",
@@ -366,7 +367,7 @@
366367
},
367368
{
368369
"cell_type": "code",
369-
"execution_count": 4,
370+
"execution_count": null,
370371
"metadata": {
371372
"colab": {},
372373
"colab_type": "code",
@@ -389,7 +390,7 @@
389390
},
390391
{
391392
"cell_type": "code",
392-
"execution_count": 5,
393+
"execution_count": null,
393394
"metadata": {
394395
"colab": {},
395396
"colab_type": "code",
@@ -414,7 +415,7 @@
414415
},
415416
{
416417
"cell_type": "code",
417-
"execution_count": 6,
418+
"execution_count": null,
418419
"metadata": {
419420
"colab": {},
420421
"colab_type": "code",
@@ -479,7 +480,7 @@
479480
},
480481
{
481482
"cell_type": "code",
482-
"execution_count": 8,
483+
"execution_count": null,
483484
"metadata": {
484485
"colab": {},
485486
"colab_type": "code",
@@ -546,7 +547,7 @@
546547
},
547548
{
548549
"cell_type": "code",
549-
"execution_count": 10,
550+
"execution_count": null,
550551
"metadata": {
551552
"colab": {},
552553
"colab_type": "code",
@@ -615,7 +616,7 @@
615616
},
616617
{
617618
"cell_type": "code",
618-
"execution_count": 11,
619+
"execution_count": null,
619620
"metadata": {
620621
"colab": {},
621622
"colab_type": "code",
@@ -821,6 +822,7 @@
821822
},
822823
"kernelspec": {
823824
"display_name": "Python 3",
825+
"language": "python",
824826
"name": "python3"
825827
}
826828
},

0 commit comments

Comments
 (0)