-
Notifications
You must be signed in to change notification settings - Fork 221
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
Mean average precision (mAP) metric #15
base: master
Are you sure you want to change the base?
Conversation
@@ -1,2 +1,4 @@ | |||
keras-rcnn was written by Allen Goodman. It’s maintained by Allen Goodman and | |||
various contributors: | |||
|
|||
Jane Hung |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're welcome to add your personal address and Twitter username, e.g.
Jane Hung <[email protected]> @janehung
import tensorflow | ||
|
||
def mean_average_precision(y_true, y_pred): | ||
return tensorflow.reduce_mean(tensorflow.metrics.sparse_average_precision_at_k(tensorflow.cast(y_true, tensorflow.int64), y_pred, 1)[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use keras.mean
rather than tensorflow.reduce_mean
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to implement a custom average precision function because tensorflow.metrics.sparse_average_precision_at_k expects to be updated in training (i.e. it’s incompatible with Keras’s per-batch metrics), e.g.
keras.backend.mean(keras.backend.cumsum(a) / keras.backend.cumsum(b))
is it working? |
We haven't tried it out yet so not sure.
…On Thu, Oct 19, 2017 at 5:07 PM, rspadim ***@***.***> wrote:
is it working?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJJbgs0MethjtHLuKD4EbUhNRKgV_SJCks5st7oVgaJpZM4Nuj-l>
.
|
Resolves #6