Ejemplo n.º 1
0
        def reloss(y_true, y_pred):
            """
            Custom loss to not penalize when the prediction is negative (dissimilar) and true label is 0.
            """

            loss_filter = maximum(y_true, y_pred)
            loss_filter = divide_no_nan(
                loss_filter, loss_filter)  # normalize any positive value to 1
            return multiply(loss_filter, MAE(y_true, y_pred))
Ejemplo n.º 2
0
 def result(self):
     return math.divide_no_nan(self.total, self.count)