1 import keras.backend
as K
2 from keras
import losses
6 mask = K.cast(K.not_equal(y_true, mask_value), K.floatx())
12 mask = K.cast(K.not_equal(y_true, mask_value), K.floatx())
18 mask = K.cast(K.not_equal(y_true, mask_value), K.floatx())
24 y_pred = K.clip(y_pred, K.epsilon(), 1 - K.epsilon())
26 return losses.binary_crossentropy(y_true, y_pred)
30 y_pred = K.clip(y_pred, K.epsilon(), 1 - K.epsilon())
32 return losses.categorical_crossentropy(y_true, y_pred)
37 y_pred = K.clip(y_pred, K.epsilon(), 1 - K.epsilon())
40 return K.mean(K.sum(- y_true * K.log(y_pred) - (1 - y_true) * K.log(1 - y_pred), axis=1))
44 y_pred = K.clip(y_pred, K.epsilon(), 1 - K.epsilon())
49 weights = K.cast([5.0*0.67049114189459802, 5.0*0.6574572346004135, 5.0*2.4884334247030484, 5.0*1.7074017025820696,
50 0.5*1.1687034551437478, 0.5*0.8630824121263583, 0.5*0.6372003918709082, 0.5*2.4018367377204779], K.floatx())
53 return K.mean(K.sum((- y_true * K.log(y_pred) - (1 - y_true) * K.log(1 - y_pred)) * weights, axis=1))
def multitask_loss_weighted(y_true, y_pred)
def masked_loss_categorical(y_true, y_pred)
def multitask_loss(y_true, y_pred)
def masked_loss(y_true, y_pred)
def masked_loss_binary(y_true, y_pred)
def loss_binary_crossentropy(y_true, y_pred)
def loss_categorical_crossentropy(y_true, y_pred)