新手進行深度學習。 使用gogoel tensorflow(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax.py)中的MNIST_SOFTMAX.py教程,我添加了兩個新圖層來查看發生了什麼。在tensorflow中添加更多圖層MNIST教程使精度下降
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。我可以弄清楚爲什麼會下降。
也許相關:[帶有隱藏層的神經網絡表現比沒有更差](http://stats.stackexchange.com/questions/181771/neural-net-with-hidden-layer-performing-worse-than-without) – blacksite
你可以在某處發佈完整的代碼嗎?我想看看你如何訓練。隨機梯度下降? –
代碼https://github.com/jeongsoopark/MachineLearning/blob/master/mnist_softmax.py 我只改變了張量流的默認層結構MNIST_softmax.py – jspark