Skip to content

Commit a238b14

Browse files
greninjadonnemartin
authored andcommitted
Replacing deprecated initialiser function with the new one (donnemartin#41)
1 parent 62f06d2 commit a238b14

File tree

8 files changed

+37
-37
lines changed

8 files changed

+37
-37
lines changed

deep-learning/tensor-flow-examples/notebooks/3_neural_networks/alexnet.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
"outputs": [],
231231
"source": [
232232
"# Initializing the variables\n",
233-
"init = tf.initialize_all_variables()"
233+
"init = tf.global_variables_initializer()"
234234
]
235235
},
236236
{
@@ -337,7 +337,7 @@
337337
"name": "python",
338338
"nbconvert_exporter": "python",
339339
"pygments_lexer": "ipython2",
340-
"version": "2.7.5+"
340+
"version": "2.7.12"
341341
}
342342
},
343343
"nbformat": 4,

deep-learning/tensor-flow-examples/notebooks/3_neural_networks/convolutional_network.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
"outputs": [],
214214
"source": [
215215
"# Initializing the variables\n",
216-
"init = tf.initialize_all_variables()"
216+
"init = tf.global_variables_initializer()"
217217
]
218218
},
219219
{
@@ -313,7 +313,7 @@
313313
"name": "python",
314314
"nbconvert_exporter": "python",
315315
"pygments_lexer": "ipython2",
316-
"version": "2.7.5+"
316+
"version": "2.7.12"
317317
}
318318
},
319319
"nbformat": 4,

deep-learning/tensor-flow-examples/notebooks/3_neural_networks/multilayer_perceptron.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"outputs": [],
166166
"source": [
167167
"# Initializing the variables\n",
168-
"init = tf.initialize_all_variables()"
168+
"init = tf.global_variables_initializer()"
169169
]
170170
},
171171
{
@@ -231,21 +231,21 @@
231231
],
232232
"metadata": {
233233
"kernelspec": {
234-
"display_name": "Python 3",
234+
"display_name": "Python 2",
235235
"language": "python",
236-
"name": "python3"
236+
"name": "python2"
237237
},
238238
"language_info": {
239239
"codemirror_mode": {
240240
"name": "ipython",
241-
"version": 3
241+
"version": 2
242242
},
243243
"file_extension": ".py",
244244
"mimetype": "text/x-python",
245245
"name": "python",
246246
"nbconvert_exporter": "python",
247-
"pygments_lexer": "ipython3",
248-
"version": "3.4.3"
247+
"pygments_lexer": "ipython2",
248+
"version": "2.7.12"
249249
}
250250
},
251251
"nbformat": 4,

deep-learning/tensor-flow-examples/notebooks/3_neural_networks/recurrent_network.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
],
237237
"source": [
238238
"# Initializing the variables\n",
239-
"init = tf.initialize_all_variables()\n",
239+
"init = tf.global_variables_initializer()\n",
240240
"\n",
241241
"# Launch the graph\n",
242242
"with tf.Session() as sess:\n",
@@ -286,7 +286,7 @@
286286
"name": "python",
287287
"nbconvert_exporter": "python",
288288
"pygments_lexer": "ipython2",
289-
"version": "2.7.5+"
289+
"version": "2.7.12"
290290
}
291291
},
292292
"nbformat": 4,

deep-learning/tensor-flow-exercises/2_fullyconnected.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
" # This is a one-time operation which ensures the parameters get initialized as\n",
382382
" # we described in the graph: random weights for the matrix, zeros for the\n",
383383
" # biases. \n",
384-
" tf.initialize_all_variables().run()\n",
384+
" tf.global_variables_initializer().run()\n",
385385
" print 'Initialized'\n",
386386
" for step in xrange(num_steps):\n",
387387
" # Run the computations. We tell .run() that we want to run the optimizer,\n",
@@ -544,7 +544,7 @@
544544
"num_steps = 3001\n",
545545
"\n",
546546
"with tf.Session(graph=graph) as session:\n",
547-
" tf.initialize_all_variables().run()\n",
547+
" tf.global_variables_initializer().run()\n",
548548
" print \"Initialized\"\n",
549549
" for step in xrange(num_steps):\n",
550550
" # Pick an offset within the training data, which has been randomized.\n",
@@ -589,21 +589,21 @@
589589
"colab_default_view": {},
590590
"colab_views": {},
591591
"kernelspec": {
592-
"display_name": "Python 3",
592+
"display_name": "Python 2",
593593
"language": "python",
594-
"name": "python3"
594+
"name": "python2"
595595
},
596596
"language_info": {
597597
"codemirror_mode": {
598598
"name": "ipython",
599-
"version": 3
599+
"version": 2
600600
},
601601
"file_extension": ".py",
602602
"mimetype": "text/x-python",
603603
"name": "python",
604604
"nbconvert_exporter": "python",
605-
"pygments_lexer": "ipython3",
606-
"version": "3.4.3"
605+
"pygments_lexer": "ipython2",
606+
"version": "2.7.12"
607607
}
608608
},
609609
"nbformat": 4,

deep-learning/tensor-flow-exercises/4_convolutions.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412
"num_steps = 1001\n",
413413
"\n",
414414
"with tf.Session(graph=graph) as session:\n",
415-
" tf.initialize_all_variables().run()\n",
415+
" tf.global_variables_initializer().run()\n",
416416
" print \"Initialized\"\n",
417417
" for step in xrange(num_steps):\n",
418418
" offset = (step * batch_size) % (train_labels.shape[0] - batch_size)\n",
@@ -467,21 +467,21 @@
467467
"colab_default_view": {},
468468
"colab_views": {},
469469
"kernelspec": {
470-
"display_name": "Python 3",
470+
"display_name": "Python 2",
471471
"language": "python",
472-
"name": "python3"
472+
"name": "python2"
473473
},
474474
"language_info": {
475475
"codemirror_mode": {
476476
"name": "ipython",
477-
"version": 3
477+
"version": 2
478478
},
479479
"file_extension": ".py",
480480
"mimetype": "text/x-python",
481481
"name": "python",
482482
"nbconvert_exporter": "python",
483-
"pygments_lexer": "ipython3",
484-
"version": "3.4.3"
483+
"pygments_lexer": "ipython2",
484+
"version": "2.7.12"
485485
}
486486
},
487487
"nbformat": 4,

deep-learning/tensor-flow-exercises/5_word2vec.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@
744744
"num_steps = 100001\n",
745745
"\n",
746746
"with tf.Session(graph=graph) as session:\n",
747-
" tf.initialize_all_variables().run()\n",
747+
" tf.global_variables_initializer().run()\n",
748748
" print \"Initialized\"\n",
749749
" average_loss = 0\n",
750750
" for step in xrange(num_steps):\n",
@@ -867,21 +867,21 @@
867867
"colab_default_view": {},
868868
"colab_views": {},
869869
"kernelspec": {
870-
"display_name": "Python 3",
870+
"display_name": "Python 2",
871871
"language": "python",
872-
"name": "python3"
872+
"name": "python2"
873873
},
874874
"language_info": {
875875
"codemirror_mode": {
876876
"name": "ipython",
877-
"version": 3
877+
"version": 2
878878
},
879879
"file_extension": ".py",
880880
"mimetype": "text/x-python",
881881
"name": "python",
882882
"nbconvert_exporter": "python",
883-
"pygments_lexer": "ipython3",
884-
"version": "3.4.3"
883+
"pygments_lexer": "ipython2",
884+
"version": "2.7.12"
885885
}
886886
},
887887
"nbformat": 4,

deep-learning/tensor-flow-exercises/6_lstm.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@
928928
"summary_frequency = 100\n",
929929
"\n",
930930
"with tf.Session(graph=graph) as session:\n",
931-
" tf.initialize_all_variables().run()\n",
931+
" tf.global_variables_initializer().run()\n",
932932
" print 'Initialized'\n",
933933
" mean_loss = 0\n",
934934
" for step in xrange(num_steps):\n",
@@ -1042,21 +1042,21 @@
10421042
"colab_default_view": {},
10431043
"colab_views": {},
10441044
"kernelspec": {
1045-
"display_name": "Python 3",
1045+
"display_name": "Python 2",
10461046
"language": "python",
1047-
"name": "python3"
1047+
"name": "python2"
10481048
},
10491049
"language_info": {
10501050
"codemirror_mode": {
10511051
"name": "ipython",
1052-
"version": 3
1052+
"version": 2
10531053
},
10541054
"file_extension": ".py",
10551055
"mimetype": "text/x-python",
10561056
"name": "python",
10571057
"nbconvert_exporter": "python",
1058-
"pygments_lexer": "ipython3",
1059-
"version": "3.4.3"
1058+
"pygments_lexer": "ipython2",
1059+
"version": "2.7.12"
10601060
}
10611061
},
10621062
"nbformat": 4,

0 commit comments

Comments
 (0)