MCPcopy Create free account
hub / github.com/CandleLabAI/PCBSegClassNet / jacard_coef

Function jacard_coef

src/models/loss.py:23–30  ·  view source on GitHub ↗
(y_true, y_pred)

Source from the content-addressed store, hash-verified

21
22
23def jacard_coef(y_true, y_pred):
24 smooth = K.epsilon()
25 y_true_f = K.flatten(y_true)
26 y_pred_f = K.flatten(y_pred)
27 intersection = K.sum(y_true_f * y_pred_f)
28 return (intersection + smooth) / (
29 K.sum(y_true_f) + K.sum(y_pred_f) - intersection + smooth
30 )
31
32
33def jacard_coef_loss(y_true, y_pred):

Callers 1

jacard_coef_lossFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected