caicloud / tensorflow-tutorial

Example TensorFlow codes and Caicloud TensorFlow as a Service dev environment.
2.93k stars 2.08k forks source link

Update 1. 自定义损失函数.ipynb #14

Closed Matrixsun closed 7 years ago

Matrixsun commented 7 years ago

修改了MSE API 的调用方式

perhapszzy commented 7 years ago

0.12.0版本中loss还是在contrib中的,修改之后会导致错误:

AttributeErrorTraceback (most recent call last)
<ipython-input-7-963da2e487f4> in <module>()
      1 
----> 2 loss = tf.losses.mean_squared_error(y, y_)
      3 train_step = tf.train.AdamOptimizer(0.001).minimize(loss)
      4 
      5 with tf.Session() as sess:

AttributeError: 'module' object has no attribute 'losses'