code_loader.leap_binder.add_custom_metric(
function=Callable[..., tf.Tensor],
name=str
)
import tensorflow as tf
def custom_metric_mean_distance(y_true, y_pred):
rank = len(y_true.shape)
axis = range(1, rank)
diff = y_true - y_pred
return tf.reduce_mean(diff, axis=axis)
leap_binder.add_custom_metric(custom_metric_mean_distance, "mean distance")