老师,能解释一下这个地方吗?不是很清楚

来源:4-23 动手实现CNN卷积神经网络(五)

baby猫

2019-07-13

图片描述

老师,这里的[1]具体是什么含义?我也看了以下官方文档,但不是很清楚呢。手机拍的图,不是很清晰,望见谅。

写回答

1回答

Oscar

2019-07-15

tf.metrics.accuracy 方法的官方文档在 这里

这个方法返回两个值,所以 [1] 是表示取第二个值(从 0 开始记数):

  • accuracy: A Tensor representing the accuracy, the value of total divided by count.

  • update_op: An operation that increments the total and count variables appropriately and whose value matches accuracy.

就是把返回值里的 update_op 赋值给 我们自己定义的 accuracy(“精度”)这个变量。

之后的代码用 

test_accuracy = sess.run(accuracy, {input_x: test_x, output_y: test_y})

来 run(运行) 这个 operation(操作)的。

0
0

基于Python玩转人工智能最火框架 TensorFlow应用实践

机器学习入门,打牢TensorFlow框架应用是关键!

2214 学习 · 688 问题

查看课程