4
$\begingroup$

In a neural network class I'm taking the error measure is defined as:

enter image description here

If the purpose of squaring the difference of the predicted and target values is to always have a positive value, then why not just use the absolute value of the difference instead?

Secondly, why is the summation halved?

$\endgroup$
1
  • 1
    $\begingroup$ Please add the [self-study] tag & read its wiki. Then tell us what you understand thus far, what you've tried & where you're stuck. We'll provide hints to help you get unstuck. $\endgroup$ Commented Oct 19, 2016 at 15:14

1 Answer 1

16
$\begingroup$
  1. The two are not equivalent (minimizing one or the other may not give you the same optimal model or model parameters), but both are used. They are sometimes referred to as the L1 and L2 loss functions for the absolute value and squared versions, respectively.

  2. The coefficient in front of the summation is immaterial. The reason why it's one half is a convention to make the math come out nicer: if $f(x) = \frac{1}{2}x^2$, then $f'(x) = x$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.