mirror of
https://github.com/wassname/keras-contrib.git
synced 2026-06-27 16:10:11 +08:00
14 lines
286 B
Python
14 lines
286 B
Python
import numpy as np
|
|
|
|
from keras import backend as K
|
|
|
|
all_metrics = []
|
|
all_sparse_metrics = []
|
|
|
|
|
|
def validate_metric(metric):
|
|
y_a = K.variable(np.random.random((6, 7)))
|
|
y_b = K.variable(np.random.random((6, 7)))
|
|
output = metric(y_a, y_b)
|
|
assert K.eval(output).shape == ()
|