public static KerasSymbol MeanSquaredLogrithmicError(KerasSymbol y_true, KerasSymbol y_pred) { var first_log = K.Log(K.Clip(y_pred, K.Epsilon(), null) + 1); var second_log = K.Log(K.Clip(y_true, K.Epsilon(), null) + 1); return(K.Mean(K.Square(first_log - second_log), axis: -1)); }
public static KerasSymbol Poisson(KerasSymbol y_true, KerasSymbol y_pred) { return(K.Mean(y_pred - y_true * K.Log(y_pred + K.Epsilon()), axis: -1)); }
public static KerasSymbol KullbackLeiblerDivergence(KerasSymbol y_true, KerasSymbol y_pred) { y_true = K.Clip(y_true, K.Epsilon(), 1); y_pred = K.Clip(y_pred, K.Epsilon(), 1); return(K.Sum(y_true * K.Log(y_true / y_pred), axis: -1)); }