gradient descent
It’s hard to make globally optimal solution, so therefore we instead make local progress.
constituents parameters \theta step size \alpha cost function J (and its derivative J’) requirements let \theta^{(0)} = 0 (or a random point), and then:
“update the weight by taking a step in the opposite direction of the gradient by weight”. We stop, btw, when its “good enough” because the training data noise is so much that like a little bit non-convergent optimization its fine.
additional information multi-dimensional case \begin{equation} \theta^{(t+1)} = \theta^{(t)} - \alpha \nabla J\left(\theta^{(t)}\right) \end{equation}
where:
gradient descent for least-squares error We have:
we want to take the derivative of this, which actually is chill
recall that h_{\theta}(x) = \theta_{0} x_{0} + \ldots
and so: \dv \theta_{j} h_{\theta}(x) = x_{j} since every other term goes to 0.
So, our update rule is:
Meaning, in vector notation: \theta^{(t+1)} = \theta^{(t)}-\alpha \sum_{i=1}^{n} \left(h_{\theta }\left(x^{(i)}\right) - y^{(i)}\right)x^{(i)}
when does gradient descent provably work? … on convex functions
stochastic gradient descent see stochastic gradient descent