TensorFlow入門教程(五):MNIST手寫數字識別加強版

一、  代價函數 上一節中,我們採用的代價函數爲: loss = tf.reduce_mean(tf.square(y - prediction)) # 求預測平均誤差 如果,將代價函數改爲交叉熵代價函數,其訓練速度,精度,將更快。(詳情百度數學原理) loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y,
相關文章
相關標籤/搜索