Skip to content

Commit

Permalink
Fix a bug in the metrics module so that predictions that correspond t…
Browse files Browse the repository at this point in the history
…o invalid

labels are reset to a value less than valid scores.

PiperOrigin-RevId: 224275717
  • Loading branch information
sbruch committed Dec 6, 2018
1 parent 60bf680 commit ad34142
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorflow_ranking/python/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def _prepare_and_validate_params(labels, predictions, weights=None, topn=None):
labels = array_ops.where(is_label_valid, labels, array_ops.zeros_like(labels))
predictions = array_ops.where(
is_label_valid, predictions,
-1e-6 * array_ops.zeros_like(predictions) + math_ops.reduce_min(
-1e-6 * array_ops.ones_like(predictions) + math_ops.reduce_min(
predictions, axis=1, keepdims=True))
return labels, predictions, example_weights, topn

Expand Down

0 comments on commit ad34142

Please sign in to comment.