From 6496cc617b6d473e090f92140e93dc34e38f8c0b Mon Sep 17 00:00:00 2001 From: Aurelien Geron Date: Thu, 6 Oct 2016 14:52:36 +0200 Subject: [PATCH] Little tweaks to beautify code in chapter 14 --- 14_recurrent_neural_networks.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/14_recurrent_neural_networks.ipynb b/14_recurrent_neural_networks.ipynb index 440672371..232627ce4 100644 --- a/14_recurrent_neural_networks.ipynb +++ b/14_recurrent_neural_networks.ipynb @@ -834,7 +834,7 @@ "with tf.Session() as sess:\n", " init.run()\n", " for epoch in range(n_epochs):\n", - " for iteration in range(len(mnist.test.labels)//batch_size):\n", + " for iteration in range(mnist.train.num_examples // batch_size):\n", " X_batch, y_batch = mnist.train.next_batch(batch_size)\n", " X_batch = X_batch.reshape((-1, n_steps, n_inputs))\n", " sess.run(training_op, feed_dict={X: X_batch, y: y_batch})\n", @@ -1010,7 +1010,7 @@ "with tf.Session() as sess:\n", " init.run()\n", " for epoch in range(n_epochs):\n", - " for iteration in range(len(mnist.test.labels)//batch_size):\n", + " for iteration in range(mnist.train.num_examples // batch_size):\n", " X_batch, y_batch = mnist.train.next_batch(batch_size)\n", " X_batch = X_batch.reshape((-1, n_steps, n_inputs))\n", " sess.run(training_op, feed_dict={X: X_batch, y: y_batch})\n", @@ -1837,7 +1837,7 @@ "with tf.Session() as sess:\n", " init.run()\n", " for epoch in range(n_epochs):\n", - " for iteration in range(len(mnist.test.labels)//batch_size):\n", + " for iteration in range(mnist.train.num_examples // batch_size):\n", " X_batch, y_batch = mnist.train.next_batch(batch_size)\n", " X_batch = X_batch.reshape((batch_size, n_steps, n_inputs))\n", " sess.run(training_op, feed_dict={X: X_batch, y: y_batch})\n",