Skip to content
Browse files

Add explanation of scoped metric definition (#281)

Based on explanation by @lgeiger
  • Loading branch information
leonoverweel authored and lgeiger committed Oct 8, 2019
1 parent 07b798e commit 934b2f9f3847be7107bdf20d1c77a6ea7b9b1d65
Showing with 7 additions and 0 deletions.
  1. +7 −0 larq/
@@ -1,3 +1,10 @@
"""We add metrics specific to extremely quantized networks using a `scope` rather than
through the `metrics` parameter of `model.compile()`, where most common metrics reside.
This is because, to calculate metrics like the `flip_ratio`, we need a layer's kernel or
activation and not just the `y_true` and `y_pred` that Keras passes to metrics defined
in the usual way.

import tensorflow as tf
from larq import utils
import numpy as np

0 comments on commit 934b2f9

Please sign in to comment.
You can’t perform that action at this time.