Skip to content

Commit e704d0f

Browse files
author
Ryo Miyajima
committed
in the middle of copying expert example, realizes that batch normalization for convolutional networks aren't that simple
1 parent 0ac2e6d commit e704d0f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mnist.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def max_pool_2x2(x):
4444
return tf.nn.max_pool(x, ksize=[1, 2, 2, 1], strides=[1,2,2,1], padding='SAME')
4545

4646
def inference(images, hidden1_units, hidden2_units):
47+
# FIXME: deprecated documentation
4748
"""Build the MNIST model up to where it may be used for inference.
4849
4950
Args:
@@ -54,6 +55,14 @@ def inference(images, hidden1_units, hidden2_units):
5455
Returns:
5556
softmax_linear: Output tensor with the computed logits.
5657
"""
58+
59+
# first convolutional layer
60+
W_conv1 = weight_variable([5, 5, 1, 32])
61+
b_conv1 = bias_variable([32])
62+
63+
x_image = tf.reshape(images, [-1, 28, 28, 1])
64+
h_conv1 = tf.nn.relu(conv2d(x_image, W_conv1) + b_conv1)
65+
5766
# Hidden 1
5867
with tf.name_scope('hidden1') as scope:
5968
weights = tf.Variable(

0 commit comments

Comments
 (0)