codecamp

TensorFlow函数:tf.metrics.percentage_below

tf.metrics.percentage_below函数

tf.metrics.percentage_below(
    values,
    threshold,
    weights=None,
    metrics_collections=None,
    updates_collections=None,
    name=None
)

定义在:tensorflow/python/ops/metrics_impl.py.

计算小于给定阈值的值的百分比.

该percentage_below函数创建两个局部变量,total和count,它们被用于计算低于threshold的values的values百分比.这个速率是由weights加权,并且它最终返回percentage,这是一种幂等运算,简单地用count除total.

为了估计数据流上的度量,该函数创建一个update_op操作来更新这些变量并返回percentage.

如果weights是None,则权重默认为1,使用权重0来屏蔽值.

参数:

  • values:任意大小的数值Tensor.
  • threshold:标量阈值.
  • weights:可选的Tensor,其秩为0或与values具有相同秩,并且必须可广播到values(即,所有维度必须为1,或与相应的values维度相同).
  • metrics_collections:度量值变量应添加到的集合的可选列表
  • updates_collections:度量标准更新操作应添加到的集合的可选列表.
  • name:可选的variable_scope名称.

返回:

  • percentage:一个代表当前均值的Tensor,total除以count的值.
  • update_op:适当增加total和count变量的操作.

可能引发的异常:

  • ValueError:如果weights不是None,和它的形状与values不匹配,或者如果metrics_collections或updates_collections中的任意一个是不是一个列表或元组.
  • RuntimeError:如果启用了急切执行.
TensorFlow函数:tf.metrics.mean_tensor
TensorFlow函数:tf.metrics.precision
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }