From a32d76c934b645d14525a3a909b0ccf3d79d8cd6 Mon Sep 17 00:00:00 2001 From: jhung0 Date: Fri, 2 Jun 2017 13:23:24 -0400 Subject: [PATCH 1/2] mean average precision --- AUTHORS.rst | 1 + keras_rcnn/metrics.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index f05496db..a4ec4e5f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,2 +1,3 @@ keras-rcnn was written by Allen Goodman. It’s maintained by Allen Goodman and various contributors: +Jane Hung \ No newline at end of file diff --git a/keras_rcnn/metrics.py b/keras_rcnn/metrics.py index e69de29b..9d46f524 100644 --- a/keras_rcnn/metrics.py +++ b/keras_rcnn/metrics.py @@ -0,0 +1,4 @@ +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]) \ No newline at end of file From 416514dc59b5a5b8290404d662fe810a78fb2b50 Mon Sep 17 00:00:00 2001 From: Allen Goodman Date: Fri, 2 Jun 2017 13:56:09 -0400 Subject: [PATCH 2/2] Update AUTHORS.rst --- AUTHORS.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index a4ec4e5f..521e7005 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,3 +1,4 @@ keras-rcnn was written by Allen Goodman. It’s maintained by Allen Goodman and various contributors: -Jane Hung \ No newline at end of file + +Jane Hung