Skip to content

Commit

Permalink
Updates for unity and understandability (hunkim#67)
Browse files Browse the repository at this point in the history
* Update lab-10-1-mnist_softmax.py

* Update lab-10-2-mnist_nn.py

* Update lab-10-3-mnist_nn_xavier.py

* Update lab-10-4-mnist_nn_deep.py

* Update lab-10-5-mnist_nn_dropout.py

* Update lab-11-1-mnist_cnn.py

* Update lab-11-2-mnist_deep_cnn.py

* Update lab-13-1-mnist_using_scope.py

* Update lab-13-2-mnist_tensorboard.py

* Update lab-13-3-mnist_save_restore.py
  • Loading branch information
BlueMelon715 authored and hunkim committed Mar 14, 2017
1 parent ad51bdf commit c52cfc7
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lab-10-1-mnist_softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1]}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1]}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-10-2-mnist_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1]}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1]}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-10-3-mnist_nn_xavier.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1]}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1]}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-10-4-mnist_nn_deep.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1]}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1]}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-10-5-mnist_nn_dropout.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1], keep_prob: 1}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1], keep_prob: 1}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-11-1-mnist_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1]}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1]}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-11-2-mnist_deep_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1], keep_prob: 1}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1], keep_prob: 1}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-13-1-mnist_using_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1], keep_prob: 1}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1], keep_prob: 1}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-13-2-mnist_tensorboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1], keep_prob: 1}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1], keep_prob: 1}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down
2 changes: 1 addition & 1 deletion lab-13-3-mnist_save_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
r = random.randint(0, mnist.test.num_examples - 1)
print("Label: ", sess.run(tf.argmax(mnist.test.labels[r:r + 1], 1)))
print("Prediction: ", sess.run(
tf.argmax(hypothesis, 1), {X: mnist.test.images[r:r + 1], keep_prob: 1}))
tf.argmax(hypothesis, 1), feed_dict={X: mnist.test.images[r:r + 1], keep_prob: 1}))

# plt.imshow(mnist.test.images[r:r + 1].
# reshape(28, 28), cmap='Greys', interpolation='nearest')
Expand Down

0 comments on commit c52cfc7

Please sign in to comment.