Я проверял этот урок на предмет глубокого изучения, он создал просто сетевую сеть с одним скрытым слоем.я сделал то же самое, и он работал нормально (точность 94%), теперь я добавил еще один слой, и его точность снизилась до (10%). Я не знаю почему?Ниже мой код
`import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
sess = tf.InteractiveSession()
mnist = input_data.read_data_sets("MNIST_data/",one_hot=True)
input_images = tf.placeholder(tf.float32,shape=[None,784])
target_labels = tf.placeholder(tf.float32,shape=[None,10])
hidden_nodes1 = 512
hidden_nodes2 = 256
input_weights = tf.Variable(tf.truncated_normal([784,hidden_nodes1]))
input_biases = tf.Variable(tf.zeros([hidden_nodes1]))
hidden_weights1 = tf.Variable(tf.truncated_normal([hidden_nodes1,hidden_nodes2]))
hidden_biases1 = tf.Variable(tf.zeros([hidden_nodes2]))
hidden_weights2 = tf.Variable(tf.truncated_normal([hidden_nodes2,10]))
hidden_biases2 = tf.Variable(tf.zeros([10]))
input_layer = tf.matmul(input_images,input_weights)
hidden_layer1 = tf.nn.relu(input_layer + input_biases)
hidden_layer2 = tf.nn.relu(tf.matmul(hidden_layer1,hidden_weights1) + hidden_biases1)
digits_weights = tf.matmul(hidden_layer2,hidden_weights2)+hidden_biases2
loss_funtion = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=digits_weights,labels=target_labels))
optimizer = tf.train.GradientDescentOptimizer(0.2).minimize(loss_funtion)
correct_prediction = tf.equal(tf.argmax(digits_weights,1),tf.argmax(target_labels,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction,tf.float32))
tf.global_variables_initializer().run()
for x in range(2000):
batch = mnist.train.next_batch(100)
optimizer.run(feed_dict={input_images:batch[0],target_labels:batch[1]})
if ((x+1)%100==0):
print("Training Epoc"+str(x+1))
print("Accuracy"+str(accuracy.eval(feed_dict={input_images:mnist.test.images,target_labels:mnist.test.labels})))`