Exemple #1
0
    def expected_squared_hinge(target, prediction):
        target = 2 * target - 1
        pred_mean, pred_var = unpack_mean_var(prediction)

        mean_unsqrd, var_unsqrd = transfer.rectifier(
            margin - target * pred_mean, pred_var)
        # See Murphy, "Machine Learning: A Probabilist Perspective", Eq (2.26)
        # for the following step.
        mean = var_unsqrd + mean_unsqrd ** 2

        return mean
Exemple #2
0
    def expected_squared_hinge(target, prediction):
        target = 2 * target - 1
        pred_mean, pred_var = unpack_mean_var(prediction)

        mean_unsqrd, var_unsqrd = transfer.rectifier(
            margin - target * pred_mean, pred_var)
        # See Murphy, "Machine Learning: A Probabilist Perspective", Eq (2.26)
        # for the following step.
        mean = var_unsqrd + mean_unsqrd ** 2

        return mean
Exemple #3
0
 def expected_hinge(target, prediction):
     target = 2 * target - 1
     pred_mean, pred_var = unpack_mean_var(prediction)
     mean, _ = transfer.rectifier(margin - target * pred_mean, pred_var)
     return mean
Exemple #4
0
 def expected_hinge(target, prediction):
     target = 2 * target - 1
     pred_mean, pred_var = unpack_mean_var(prediction)
     mean, _ = transfer.rectifier(margin - target * pred_mean, pred_var)
     return mean