Suppose I have this custom loss:
def custom_loss(y_true, y_pred):
out = K.clip(y_pred, 1e-8, 1-1e-8)
log_lik = y_true*K.log(out)
return K.sum(-log_lik*advantages)
How does keras (with TF as backend) know how to differentiate in terms of the input specifically and ignore the 'advantages' simply as coefficient? Does it do it numerically? If so is that the same as with it's own loss functions or only with custom?