mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-24 10:13:00 +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_pred = 1 - y_pred
|
||||
fp = K.sum(neg_y_true * y_pred)
|
||||
tn = K.sum(neg_y_true * neg_y_pred)
|
||||
specificity = tn / (tn + fp + K.epsilon())
|
||||
fp = tf.math.reduce_sum(neg_y_true * y_pred)
|
||||
tn = tf.math.reduce_sum(neg_y_true * neg_y_pred)
|
||||
specificity = tn / (tn + fp + tf.keras.backend.epsilon())
|
||||
return specificity
|
||||
|
|
Loading…
Reference in a new issue