mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-04 17:13:02 +00:00
specificity: convert to plaintf
This commit is contained in:
parent
26cc824ace
commit
c7b577ab29
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ def specificity(y_pred, y_true):
|
||||||
|
|
||||||
neg_y_true = 1 - y_true
|
neg_y_true = 1 - y_true
|
||||||
neg_y_pred = 1 - y_pred
|
neg_y_pred = 1 - y_pred
|
||||||
fp = K.sum(neg_y_true * y_pred)
|
fp = tf.math.reduce_sum(neg_y_true * y_pred)
|
||||||
tn = K.sum(neg_y_true * neg_y_pred)
|
tn = tf.math.reduce_sum(neg_y_true * neg_y_pred)
|
||||||
specificity = tn / (tn + fp + K.epsilon())
|
specificity = tn / (tn + fp + tf.keras.backend.epsilon())
|
||||||
return specificity
|
return specificity
|
||||||
|
|
Loading…
Reference in a new issue