Answers.Body: <p>To simplify the derivative, probably. Otherwise there will be constant 2 in it. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-01T13:56:49.717Z
Answers.Text: I think it would also useful if you explain in which way it exactly simplifies the derivative (i.e. show a step by step example).
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-01T14:02:25.880Z
Answers.Text: @Harsh Yes, but I think these details should be elaborated a little more (i.e. explained more in detail), given that they might not obvious to everyone, so this question needs to be improved, IMHO.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-23T21:16:10.053Z
Answers.Text: This is the correct answer. The constant factor does not affect the optimizer of the loss, so the only reason is convenience.
Answers.UserDisplayName: Harsh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-23T15:17:53.180Z
Answers.LastActivityDate: 2017-02-23T15:17:53.180Z
Answers.UserDisplayName: avysk
Body: <p>A cost function used in machine is often the following</p>
  
  <p><span class="math-container">$$C = \frac{1}{2} \| y - \hat{y} \| ^2$$</span></p>
  
  <p>Why is there <span class="math-container">$\frac{1}{2}$</span> in front of the squared distance?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-01T15:02:48.157Z
Comments.Text: See also https://math.stackexchange.com/q/884887/168764 for more elaborate and precise answers.
Comments.UserDisplayName: nbro
Tags: <neural-networks><machine-learning><math>
Title: Why does the cost function contain a 2 at the denominator?
UserDisplayName: Dmytro Nalyvaiko
ThreadText: # Why does the cost function contain a 2 at the denominator?
  
  (Asked by: username_0 on 2017-02-23)
  
  A cost function used in machine is often the following
  
  $$C = \frac{1}{2} \| y - \hat{y} \| ^2$$
  
  Why is there $\frac{1}{2}$ in front of the squared distance?
  
  **Tags:** neural-networks, machine-learning, math
  > **Comments:**
  > **username_1**: See also https://math.stackexchange.com/q/884887/168764 for more elaborate and precise answers.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-02-23. Score: 4
  
  To simplify the derivative, probably. Otherwise there will be constant 2 in it.
  
  > **Comments:**
  > **username_3**: This is the correct answer. The constant factor does not affect the optimizer of the loss, so the only reason is convenience.  
  > **username_1**: I think it would also useful if you explain in which way it exactly simplifies the derivative (i.e. show a step by step example).  
  > **username_1**: @Harsh Yes, but I think these details should be elaborated a little more (i.e. explained more in detail), given that they might not obvious to everyone, so this question needs to be improved, IMHO.  
  
  ---
  
  