Understanding gradient descent
eli.thegreenplace.net
eli.thegreenplace.net
Suppose you solve the differential equation,
x'(t) = -f'(x(t)) (1)
Then, d/dt f(x(t)) = f'(x) x'(t) = - [f'(x)]^2 <= 0
In other words, if `x(t)` follows a path that solves (1), then `x(t)` follows a path that decreases the value of `f(x)`.The gradient descent algorithm is a numerical approximation to solving (1) using the forward Euler method:
(x(t_(n+1)) - x(t_n)) / dt = -f'(x(t_n))Say x(t) = exp(-t)
f(x(t)) = (x^2)/2
Then it satisfies conditions imposed by parent, namely x' = -x = -f'
d/dt f(x(t)) = f'(x(t)) x'(t) = -(-f'(x(t))) x'(t) = -(x'(t)) x'(t) = -[x'(t)]^2 = -[f'(x(t))]^2
?
All of these blog posts about gradient descent feel like everyone keeps going on about what a great algorithm bubblesort is because it's so easy to understand and implement.
Personally I found http://sebastianruder.com/optimizing-gradient-descent/ interesting - it goes into the advanced variants like nesterov, adadelta, etc
There's an implicit endorsement in these blog posts. People wouldn't be spilling all this ink nowadays on plain adalines, even if they're building blocks for backprop networks, right? So by writing so much about it, people get the impression that it has to be studied and implemented very carefully, to the exclusion of better methods.
Gradient descent is a standard tool for optimizing complex functions iteratively within a computer program. Its goal is: given some arbitrary function, find a minima.
For some small subset of functions - those that are convex - there's just a single minima which also happens to be global. For most realistic functions, there may be many minima, so most minima are local.
Making sure the optimization finds the "best" minima and doesn't get stuck in sub-optimial minima is out of the scope of this article.
Here we'll just be dealing with the core gradient descent algorithm for finding some minima from a given starting point.
http://www.cs.cmu.edu/%7Equake-papers/painless-conjugate-gra...
"The Concept of Conjugate Gradient Descent in Python"
http://ikuz.eu/2015/04/15/the-concept-of-conjugate-gradient-...
And for those with more math and less patience for explanation, Robert Gower also offers:
"Conjugate Gradients: The short and painful explanation with oblique projections"
http://www.maths.ed.ac.uk/~s1065527/pdf/GowerR_Painful_PCG_p...
It reminds me of taking the derivative by manually measuring the slope between 2 points on the curve, instead of, you know, directly getting the derivative
Yeah, I know. I am saying that I think there is probably an undiscovered solution to doing faster inverse matrices, based on occam's razor (which I'm taking to mean that "complex and ugly" suggests there is probably undiscovered "simpler and more elegant"... which I've seen over and over again in other areas... gradient descent being the "complex and ugly" here)
> This gives a good guess for the solution at each timestep(t>0) and improving that with gradient descent can be more performant than completely solving for a matrix inverse each time.
That's a good point, but perhaps the hypothetical matrix inversion I'm assuming exists also allows you to do computationally efficient differential inversions based on small changes to the matrix.
I admit this was just a "gut feeling," but when I first learned about gradient descent vs. matrix inversion I had a very strong gut feeling that there was a better way out there.
My career is programming (where I have followed this "gut feeling" many times, usually to success) and I did papers on matrices and determinants in high school, this may be informing my "gut".
Not sure if any mathy people are reading this, but I think there's gold to be had here, if you look hard enough
Keep in mind that many linear systems can be solved in near linear time despite the inverse being dense.
If I applied this logic to anything genuinely new that was ever discovered, then nothing genuinely new would ever be discovered. I don't know what the fallacy there is, but it must be one.
Modern example: Many, many, MANY people worked on globally disparate data synchronization (consensus) problems (Raft, Paxos were some solutions), while ensuring their security, and then Bitcoin came along. Bitcoin hasn't been hacked (although its exchanges have).
I'm just saying my gut says there's more to discover there.
What I'm trying to say is that occam's razor seems to suggest that there is a better way to do matrix inversions which we simply haven't discovered yet.
Occam's razor doesn't suggest that. Such a method is an additional assumed entity that adds nothing to our ability to explain what is observed, and is thus the kind of thing Occam's razor calls one to reject, rather than suggests.
Now, belief in the existence of such a method might be a means of satisfying an aesthetic preference for a computationally convenient universe, but that's something very different than Occam's razor.
for anyone else curious