def poisson(y_true, y_pred): return K.mean(y_pred - y_true * K.log(y_pred + K.epsilon()), axis=-1)
def mean_squared_logarithmic_error(y_true, y_pred): first_log = K.log(K.clip(y_pred, K.epsilon(), np.inf) + 1.) second_log = K.log(K.clip(y_true, K.epsilon(), np.inf) + 1.) return K.mean(K.square(first_log - second_log), axis=-1)
def kl_divergence(p, p_hat): return p_hat - p + p * K.log(p / p_hat)