def accuracy_without_true_negatives(true_positives, false_positives,
false_negatives):
"""Creates an op for calculating accuracy without true negatives.
Args:
true_positives: A tensor representing true_positives.
false_positives: A tensor representing false_positives.
false_negatives: A tensor representing false_negatives.
Returns:
A tensor with the result of the calculation.
"""
return tf.where(
tf.greater(true_positives + false_positives + false_negatives, 0),
true_positives / (true_positives + false_positives + false_negatives), 0)
评论列表
文章目录