lab11-2

MNIST 99% with CNN

Conv layer 1

...
#MNIST Source before this code 

# Input placeholders
X = tf.placeholder(tf.float32, [None, 784])
X_img = tf.reshape(X, [-1, 28, 28, 1]) # img 28x28x1 (black/white)

# L1 ImgIn shape=(?, 28, 28, 1)
# 1x1 color, 32 filters
W1 = tf.Variable(tf.random_normal([3, 3, 1, 32], stddev=0.01))
#    Conv    -> (?, 28, 28, 32)
#    Pool    -> (?, 14, 14, 32)
L1 = tf.nn.conv2d(X_img, W1, strides=[1, 1, 1, 1], padding='SAME')
L1 = tf.nn.relu(L1)
L1 = tf.nn.max_pool(L1, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='SAME')

# Print한 결과
...
Tensor("Conv2D:0", shape=(?, 28, 28, 32), dtype=float32)
Tensor("Relu:0", shape=(?, 28, 28, 32), dtype=float32)
Tensor("MaxPool:0", shape=(?, 14, 14, 32), dtype=float32) ## 이것을 두번째 Conv Layer의 입력값으로 사용하게 된다.

Conv layer2dropout 과 추가적인 레이어 적용

results for ""

    No results matching ""