【发布时间】:2017-06-18 23:58:14
【问题描述】:
深度学习新手。 使用 gogoel tensorflow (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax.py) 的 MNIST_SOFTMAX.py 教程,我添加了两个新层来看看会发生什么。
x = tf.placeholder(tf.float32, [None, 784])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
y = tf.matmul(x, W) + b
把上面的代码改成
x = tf.placeholder(tf.float32, [None, 784])
W1 = tf.Variable(tf.zeros([784, 256]))
W2 = tf.Variable(tf.zeros([256, 256]))
W3 = tf.Variable(tf.zeros([256, 10]))
B1 = tf.Variable(tf.zeros([256]))
B2 = tf.Variable(tf.zeros([256]))
B3 = tf.Variable(tf.zeros([10]))
Y1 = tf.matmul(x, W1) + B1
Y2 = tf.matmul(Y1, W2) + B2
Y3 = tf.matmul(Y2, W3) + B3
y = Y3
它将精度从 0.9188 降低到 0.1028。我能知道它为什么会下降吗?
【问题讨论】:
-
你能把完整的代码贴在某个地方吗?我想看看你是怎么训练的。随机梯度下降?
-
github.com/jeongsoopark/MachineLearning/blob/master/… 中的代码我只更改了 tensorflow 的默认 MNIST_softmax.py 的层结构
标签: machine-learning tensorflow neural-network deep-learning mnist