algebraic-number

Keras custom loss implementation : ValueError: An operation has `None` for gradient

倾然丶 夕夏残阳落幕 提交于 2020-01-23 04:40:11
问题 I'm trying to implement this loss function : MCFD_loss_function from this document (P6) : Loss functions So I created a new function like this : def mcfd_loss(y_true, y_pred): return K.sum( # ∑ K.cast( K.greater( # only values greater than 0 (+ float32 cast) K.dot(K.sign(y_pred), # π K.sign(y_true)) , 0) , 'float32') ) But when I start training this error is raised : ValueError: An operation has None for gradient. Please make sure that all of your ops have a gradient defined (i.e. are