python - tf.contrib.metrics.streaming_auc 中 update_op 返回值的用途是什么

标签 python tensorflow

我引用了这个文档: https://www.tensorflow.org/versions/r1.1/api_docs/python/tf/contrib/metrics/streaming_auc

对于一般的流媒体指标,但让我们以 auc 为例,作为返回值的 update_op 是什么意思?您必须在调用 streaming_auc() 之后调用此操作来更新 streaming_acu() 的累加器吗?

最佳答案

您需要此操作来收集样本并建立统计数据。

直接来自 the docs :

labels = ...
predictions = ...
accuracy, update_op_acc = tf.contrib.metrics.streaming_accuracy(
    labels, predictions)
error, update_op_error = tf.contrib.metrics.streaming_mean_absolute_error(
    labels, predictions)

sess.run(tf.local_variables_initializer())
for batch in range(num_batches):
  sess.run([update_op_acc, update_op_error])

accuracy, mean_absolute_error = sess.run([accuracy, mean_absolute_error])

关于python - tf.contrib.metrics.streaming_auc 中 update_op 返回值的用途是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43523058/

相关文章:

python - Pandas : Count Intervall

python - 函数闭包和 Python 中对象名称中 <locals> 语法的含义

python - 在 GPU 上结合使用 Flair 和 TensorFlow 会产生错误

python - 如何将 tf.lookup 表与 TensorFlow 2.0 keras 和 MLFlow 结合使用

linux - tf_version_script 给出语法错误

python - 如何使用 keras.backend.gradients() 获取梯度值

python - 使用 python pandas .to_csv 附加到 csv 时如何强制换行

python - Fillna 一次使用多种方法 - pandas

go - 在 Go 中加载 Tensorflow 模型时无法预测

python - Matplotlib/Pandas 中的链接和画笔——在另一个图中绘制一个图中的选定点