Little tweaks to beautify code in chapter 14
parent
0d08368095
commit
4b15a6cf19
|
@ -558,7 +558,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",
|
||||
|
@ -627,7 +627,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",
|
||||
|
@ -1187,7 +1187,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",
|
||||
|
|
Loading…
Reference in New Issue