TensorFlow函数:tf.metrics.true_positives_at_thresholds

2018-11-12 14:19 更新

tf.metrics.true_positives_at_thresholds函数

tf.metrics.true_positives_at_thresholds(
    labels,
    predictions,
    thresholds,
    weights=None,
    metrics_collections=None,
    updates_collections=None,
    name=None
)

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

在提供的阈值处计算true positives.

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

参数:

  • labels:一个Tensor,它的形状与predictions匹配,将被转换为bool.
  • predictions:任意形状的浮点Tensor,其值在该范围[0, 1]内.
  • thresholds:[0, 1]中浮动阈值的一个python列表或元组.
  • weights:可选的Tensor其秩为0或与labels具有相同的秩,并且必须可广播到labels(即,所有维度必须为1并且与相应的labels维度相同).
  • metrics_collections:true_positives应添加到的集合的可选列表.
  • updates_collections:update_op应添加到的集合的可选列表.
  • name:可选的variable_scope名称.

返回:

  • true_positives:一个浮动Tensor,其形状为[len(thresholds)].
  • update_op:更新true_positives变量并返回其当前值的操作.

可能引发的异常:

  • ValueError:如果predictions和labels有不匹配的形状,或者weights不是None,并且它的形状不匹配predictions,或者如果任一metrics_collections或者updates_collections不是一个列表或元组.
  • RuntimeError:如果启用了急切执行.
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy