View source on GitHub |
Creates a finalizer function for the given Keras metric.
tff.learning.metrics.create_keras_metric_finalizer(
metric: Union[tf.keras.metrics.Metric, Callable[[], tf.keras.metrics.Metric]]
) -> KerasMetricFinalizer
Args | |
---|---|
metric
|
An instance of tf.keras.metrics.Metric or a no-arg callable that
constructs a tf.keras.metrics.Metric .
|
Returns | |
---|---|
A tf.function decorated callable that takes in the unfinalized metric
values (i.e., tensor values of the variables in keras_metric.variables ),
and returns the value of keras_metric.result() .
|
Raises | |
---|---|
TypeError
|
If metric is not a tf.keras.metrics.Metric and not a no-arg
callable that returns a tf.keras.metrics.Metric .
|