python 张量流均值平方误差MSE

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 张量流均值平方误差MSE相关的知识,希望对你有一定的参考价值。

# create Y_predictions, in this case linear regression
Y_predictions = tf.add(b, tf.multiply(w,X))

squares = tf.square(Y - Y_predictions)

loss = tf.reduce_mean(squares, name='loss')

#gradiaent descent. pass learning rate as .01
optimizer = tf.train.GradientDescentOptimizer(0.01).minimize(loss=loss)

以上是关于python 张量流均值平方误差MSE的主要内容,如果未能解决你的问题,请参考以下文章