5,321
edits
Line 19: | Line 19: | ||
Taking the gradient and setting it to 0 we get:<br> | Taking the gradient and setting it to 0 we get:<br> | ||
<math> | <math> | ||
\ | \nabla_{\mu} L(\mu, \mathbf{z}) = \nabla_{\mu} \sum_{i} \Vert x^{(i)} - \mu_{z^{(i)}} \Vert ^2 | ||
</math><br> | </math><br> | ||
<math> | <math> | ||
= \ | = \nabla_{\mu} \sum_{j=1}^{k} \sum_{i\mid z(i)=j} \Vert x^{(i)} - \mu_{z^{(i)}} \Vert ^2 | ||
</math><br> | </math><br> | ||
<math> | <math> | ||
= \ | = \nabla_{\mu} \sum_{j=1}^{k} \sum_{i\mid z(i)=j} \Vert x^{(i)} - \mu_{j} \Vert ^2 | ||
</math><br> | </math><br> | ||
<math> | <math> | ||
= \sum_{j=1}^{k} \sum_{i\mid z(i)=j} \ | = \sum_{j=1}^{k} \sum_{i\mid z(i)=j} \nabla_{\mu} \Vert x^{(i)} - \mu_{j} \Vert ^2 | ||
</math><br> | </math><br> | ||
<math> | <math> |