Skip to content

Commit e69408d

Browse files
committed
Fix codes for 1.15
1 parent 527510b commit e69408d

3 files changed

+19
-19
lines changed

lab-05-1-logistic_regression-eager.ipynb

+15-13
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 1,
15+
"execution_count": 2,
1616
"metadata": {},
1717
"outputs": [
1818
{
1919
"name": "stdout",
2020
"output_type": "stream",
2121
"text": [
22-
"1.12.0\n"
22+
"1.15.0\n"
2323
]
2424
}
2525
],
@@ -28,7 +28,6 @@
2828
"import matplotlib.pyplot as plt\n",
2929
"%matplotlib inline\n",
3030
"import tensorflow as tf\n",
31-
"import tensorflow.contrib.eager as tfe\n",
3231
"\n",
3332
"tf.enable_eager_execution()\n",
3433
"tf.set_random_seed(777) # for reproducibility\n",
@@ -47,7 +46,7 @@
4746
},
4847
{
4948
"cell_type": "code",
50-
"execution_count": 2,
49+
"execution_count": 3,
5150
"metadata": {
5251
"scrolled": true
5352
},
@@ -107,7 +106,7 @@
107106
},
108107
{
109108
"cell_type": "code",
110-
"execution_count": 3,
109+
"execution_count": 4,
111110
"metadata": {},
112111
"outputs": [],
113112
"source": [
@@ -124,7 +123,7 @@
124123
},
125124
{
126125
"cell_type": "code",
127-
"execution_count": 4,
126+
"execution_count": 5,
128127
"metadata": {},
129128
"outputs": [],
130129
"source": [
@@ -150,7 +149,7 @@
150149
},
151150
{
152151
"cell_type": "code",
153-
"execution_count": 5,
152+
"execution_count": 6,
154153
"metadata": {},
155154
"outputs": [],
156155
"source": [
@@ -186,7 +185,7 @@
186185
},
187186
{
188187
"cell_type": "code",
189-
"execution_count": 6,
188+
"execution_count": 7,
190189
"metadata": {},
191190
"outputs": [],
192191
"source": [
@@ -208,7 +207,7 @@
208207
},
209208
{
210209
"cell_type": "code",
211-
"execution_count": 7,
210+
"execution_count": 8,
212211
"metadata": {},
213212
"outputs": [],
214213
"source": [
@@ -227,7 +226,7 @@
227226
},
228227
{
229228
"cell_type": "code",
230-
"execution_count": 8,
229+
"execution_count": 9,
231230
"metadata": {},
232231
"outputs": [],
233232
"source": [
@@ -250,13 +249,16 @@
250249
},
251250
{
252251
"cell_type": "code",
253-
"execution_count": 9,
252+
"execution_count": 10,
254253
"metadata": {},
255254
"outputs": [
256255
{
257256
"name": "stdout",
258257
"output_type": "stream",
259258
"text": [
259+
"WARNING:tensorflow:From <ipython-input-6-6afa75b867be>:2: div (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
260+
"Instructions for updating:\n",
261+
"Deprecated in favor of operator or tf.math.divide.\n",
260262
"Iter: 0, Loss: 0.6874\n",
261263
"Iter: 100, Loss: 0.5776\n",
262264
"Iter: 200, Loss: 0.5349\n",
@@ -276,7 +278,7 @@
276278
"EPOCHS = 1001\n",
277279
"\n",
278280
"for step in range(EPOCHS):\n",
279-
" for features, labels in tfe.Iterator(dataset):\n",
281+
" for features, labels in iter(dataset):\n",
280282
" grads = grad(logistic_regression(features), features, labels)\n",
281283
" optimizer.apply_gradients(grads_and_vars=zip(grads,[W,b]))\n",
282284
" if step % 100 == 0:\n",
@@ -309,7 +311,7 @@
309311
"name": "python",
310312
"nbconvert_exporter": "python",
311313
"pygments_lexer": "ipython3",
312-
"version": "3.6.5"
314+
"version": "3.6.7"
313315
}
314316
},
315317
"nbformat": 4,

lab-05-2-logistic_regression_diabetes-eager.ipynb

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"import matplotlib.pyplot as plt\n",
2828
"%matplotlib inline\n",
2929
"import tensorflow as tf\n",
30-
"import tensorflow.contrib.eager as tfe\n",
3130
"\n",
3231
"tf.enable_eager_execution()\n",
3332
"tf.set_random_seed(777) # for reproducibility\n",
@@ -249,7 +248,7 @@
249248
"EPOCHS = 1001\n",
250249
"\n",
251250
"for step in range(EPOCHS):\n",
252-
" for features, labels in tfe.Iterator(dataset):\n",
251+
" for features, labels in iter(dataset):\n",
253252
" grads = grad(logistic_regression(features), features, labels)\n",
254253
" optimizer.apply_gradients(grads_and_vars=zip(grads,[W,b]))\n",
255254
" if step % 100 == 0:\n",
@@ -280,7 +279,7 @@
280279
"name": "python",
281280
"nbconvert_exporter": "python",
282281
"pygments_lexer": "ipython3",
283-
"version": "3.6.5"
282+
"version": "3.6.7"
284283
}
285284
},
286285
"nbformat": 4,

lab-07-1-learning_rate_and_evaluation-eager.ipynb

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"%matplotlib inline\n",
3030
"import tensorflow as tf\n",
3131
"from mpl_toolkits.mplot3d import Axes3D\n",
32-
"import tensorflow.contrib.eager as tfe\n",
3332
"\n",
3433
"tf.enable_eager_execution()\n",
3534
"tf.set_random_seed(777) # for reproducibility\n",
@@ -284,7 +283,7 @@
284283
"EPOCHS = 1001\n",
285284
"\n",
286285
"for step in range(EPOCHS):\n",
287-
" for features, labels in tfe.Iterator(dataset):\n",
286+
" for features, labels in iter(dataset):\n",
288287
" features = tf.cast(features, tf.float32)\n",
289288
" labels = tf.cast(labels, tf.float32)\n",
290289
" grads = grad(softmax_fn(features), features, labels)\n",
@@ -321,7 +320,7 @@
321320
"name": "python",
322321
"nbconvert_exporter": "python",
323322
"pygments_lexer": "ipython3",
324-
"version": "3.6.5"
323+
"version": "3.6.7"
325324
}
326325
},
327326
"nbformat": 4,

0 commit comments

Comments
 (0)