TensorFlow入门教程(五):MNIST手写数字识别加强版

一、  代价函数 上一节中,我们采用的代价函数为: loss = tf.reduce_mean(tf.square(y - prediction)) # 求预测平均误差 如果,将代价函数改为交叉熵代价函数,其训练速度,精度,将更快。(详情百度数学原理) loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y,
相关文章
相关标签/搜索