Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a streaming_op() to the pr_curves plugin. #587

Merged
merged 3 commits into from
Oct 3, 2017

Conversation

agrubb
Copy link
Contributor

@agrubb agrubb commented Sep 29, 2017

This op produces the same result (a Tensor Summary containing the PR
curve data) as the existing op() function, but it does so by
aggregating the result over multiple batches of data. The function
also returns an update_op that should be used to update the summary
for each batch of data.

With these changes, the function provides a tf.metrics-like function
for generating PR curve data.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

This op produces the same result (a Tensor Summary containing the PR
curve data) as the existing op() function, but it does so by
aggregating the result over multiple batches of data.  The function
also returns an update_op that should be used to update the summary
for each batch of data.

With these changes, the function provides a tf.metrics-like function
for generating PR curve data.
@googlebot
Copy link

CLAs look good, thanks!

Copy link
Member

@chihuahua chihuahua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add an entry for pr_curve_streaming_op in summary.py after this line:
https://github.com/tensorflow/tensorboard/blob/master/tensorboard/summary.py#L42

positives, true negatives, false negatives, precision, recall.
update_op: An operation that updates the summary with the latest data.
"""
thresholds = [i * 1.0 / float(num_thresholds - 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does i / float( ... suffice? Without the * 1.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Done.

self.assertEqual(expected_proto.value[0].tag, 'pr_curve_1/pr_curves')
expected_proto.value[0].tag = 'pr_curve/pr_curves'

self.assertProtoEquals(expected_proto, proto)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, I should use assertProtoEquals more often.

@agrubb
Copy link
Contributor Author

agrubb commented Oct 3, 2017

Updated tensorboard/summary.py. Also verified all tests pass (locally) with latest tf-nightly.

@@ -164,6 +164,98 @@ def op(
description,
collections)


def streaming_op(tag, labels, predictions, num_thresholds=200, weights=None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could we reorganize the arguments to be one per row?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@chihuahua chihuahua merged commit a802650 into tensorflow:master Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants