aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/metrics
diff options
context:
space:
mode:
authorGravatar Yan Facai (颜发才) <facai.yan@gmail.com>2018-08-23 16:23:03 +0800
committerGravatar Yan Facai (颜发才) <facai.yan@gmail.com>2018-08-23 16:54:59 +0800
commit38f811077dd52820eaa3d5c684f41142de01c7eb (patch)
tree56791f8875cb4dffe56cbe2bf5a7c34e71ddacd0 /tensorflow/contrib/metrics
parentc05bb4efcaf53d4cbc315ef6d12de822f2557a13 (diff)
CLN: remove negative_to_zero argument
Diffstat (limited to 'tensorflow/contrib/metrics')
-rw-r--r--tensorflow/contrib/metrics/python/ops/metric_ops.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tensorflow/contrib/metrics/python/ops/metric_ops.py b/tensorflow/contrib/metrics/python/ops/metric_ops.py
index d972e7da53..bfef0816aa 100644
--- a/tensorflow/contrib/metrics/python/ops/metric_ops.py
+++ b/tensorflow/contrib/metrics/python/ops/metric_ops.py
@@ -3188,12 +3188,12 @@ def streaming_covariance(predictions,
# We update the means by Delta=Error*BatchCount/(BatchCount+PrevCount)
# batch_mean_prediction is E[x_B] in the update equation
batch_mean_prediction = math_ops.div_no_nan(
- math_ops.reduce_sum(weighted_predictions), batch_count,
- negative_to_zero=True,
+ math_ops.reduce_sum(weighted_predictions),
+ math_ops.maximum(batch_count, 0),
name='batch_mean_prediction')
delta_mean_prediction = math_ops.div_no_nan(
- (batch_mean_prediction - mean_prediction) * batch_count, update_count,
- negative_to_zero=True,
+ (batch_mean_prediction - mean_prediction) * batch_count,
+ math_ops.maximum(update_count, 0),
name='delta_mean_prediction')
update_mean_prediction = state_ops.assign_add(mean_prediction,
delta_mean_prediction)
@@ -3202,12 +3202,12 @@ def streaming_covariance(predictions,
# batch_mean_label is E[y_B] in the update equation
batch_mean_label = math_ops.div_no_nan(
- math_ops.reduce_sum(weighted_labels), batch_count,
- negative_to_zero=True,
+ math_ops.reduce_sum(weighted_labels),
+ math_ops.maximum(batch_count, 0),
name='batch_mean_label')
delta_mean_label = math_ops.div_no_nan(
- (batch_mean_label - mean_label) * batch_count, update_count,
- negative_to_zero=True,
+ (batch_mean_label - mean_label) * batch_count,
+ math_ops.maximum(update_count, 0),
name='delta_mean_label')
update_mean_label = state_ops.assign_add(mean_label, delta_mean_label)
# prev_mean_label is E[y_A] in the update equation
@@ -3871,8 +3871,8 @@ def cohen_kappa(labels,
total = math_ops.reduce_sum(pe_row)
pe_sum = math_ops.reduce_sum(
math_ops.div_no_nan(
- pe_row * pe_col, total,
- negative_to_zero=True,
+ pe_row * pe_col,
+ math_ops.maximum(total, 0),
name=None))
po_sum, pe_sum, total = (math_ops.to_double(po_sum),
math_ops.to_double(pe_sum),