Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
keras-rcnn was written by Allen Goodman. It’s maintained by Allen Goodman and
various contributors:

Jane Hung
Copy link
Contributor

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 <jane.hung@geocities.com> @janehung

4 changes: 4 additions & 0 deletions keras_rcnn/metrics.py
Original file line number Diff line number Diff line change
@@ -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])
Copy link
Contributor

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.

Copy link
Contributor

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))