News for hackers. Stuff that matters.
Re:The Matrix Calculus You Need for Deep Learning by TJSomething on Friday June 29, 2018 @04:29AM (#17423200)
Those Wikipedia pages are kind of awful for pedagogy, but they have the right equations, so I won't cover those.

Say we have a curve that corresponds to how good of a fit your model is. We want to try to find the maximum on that curve. However, calculating every point of the curve is too expensive, so we want to minimize the number of points we have to check. So, we start with a guess as to the highest point on the curve and take the first and second derivatives of the curve at that point. This gives us enough to fit a parabola that approximates the curve in the neighborhood of our initial guess point. Then, it's pretty easy to solve for the highest point on the parabola. That's our new guess. Repeat that a few times until the guesses stop shifting much. If the curve is nicely shaped (i.e. smooth everywhere, only has one maximum), the guesses will converge on the highest point.

This is a often faster than a similar method, gradient ascent, which relies upon only taking the first derivative. This would yield a line in the vicinity of our guess, and then we just move our guess a little bit, such that it goes up the line. This is pretty slow, since it can't just go straight to a guess of the top, and if you go too fast, then it'll blow right past the maximum.

The Hessian matrix is the higher dimensional equivalent to the second derivative there and the gradient is the equivalent for the first derivative. For example, if we have a two dimensional surface in 3D, then those matrices will be 2x2 and capture the curvature of the 3D paraboloid in the vicinity of the guess. As you go up in dimensionality, they're called quadric hypersurfaces.

When you're fitting a logistic regression, your hypersurface is the logarithm of the likelihood that the data you have fits the logistic curve with parameters at that point. The logarithm makes the hypersurface better behaved and makes the calculus easier. You just need the gradient and the Hessian, evaluate those at your initial guess, fit a quadric hypersurface to the guess there, pop up to the top of that hypersurface, repeat a few times, and you've got your model.

Re:The Matrix Calculus You Need for Deep Learning by ghaff on Friday June 29, 2018 @08:36AM (#17424119)
Unfortunately, mathematics is one of the areas where Wikipedia is pretty awful in general. The articles seem mostly written for people who pretty much already understand the topic in question. Of course, you always have to assume some knowledge base but the stereotypical jargon-filled Wilipedia approach is particularly off-putting in this area.
Re:The Matrix Calculus You Need for Deep Learning by Myrmornis on Friday June 29, 2018 @10:13AM (#17424608)
I understand what you’re trying to say, but Wikipedia is a fantastic resource for mathematics. “Pretty awful” is not a correct choice of words. But yes, much of it is written at beyond-undergrad-math level. And undergrad math is already advanced! And no I’m not someone with a math PhD talking down! I’m struggling through teaching myself undergrad math.
Re:The Matrix Calculus You Need for Deep Learning by pvg on Friday June 29, 2018 @11:32AM (#17425084)
The only way "pretty awful" is incorrect is that it is too polite and reserved. Reams upon reams of pages are written completely at odds with Wikipedia's own style guidelines and common-sense expectations of what one might find in an encyclopedia. Unlike some famously dense mathematical texts, wikipedia maths pages don't even come with any of the benefits of brevity or focus. It's like a giant joke competition of who can describe every trivial thing in the most abstract and abstruse way except it got out of hand and the participants forgot it was supposed to be a joke. Mathworld and similar sites will help you much more with undergrad maths.
Re:The Matrix Calculus You Need for Deep Learning by Myrmornis on Sunday July 01, 2018 @02:36AM (#17434412)
We’re saying much the same thing, it’s just that I find your and GP’s use of the absolute “pretty awful” to be hyperbolic and something of a loss of perspective. Remember what we have here: a free, actively maintained, accurate, comprehensive and advanced corpus of expository writing on mathematics. Adjectives that are missing there are “intuitition-rich”, and “helpful for undergraduates”. I do understand if you are disappointed with it. As noted, I (undergrad level) don’t approach it with an expectation that it will be my favorite reading on a topic.
Re:The Matrix Calculus You Need for Deep Learning by pvg on Monday July 02, 2018 @10:03AM (#17441685)
We’re saying much the same thing

No.

something of a loss of perspective.

You'd have to provide some alternative perspective or argument that goes beyond 'pretty awful sounds kinda mean'.

Remember what we have here: a free, actively maintained, accurate, comprehensive and advanced corpus of expository writing on mathematics

We already have a few of those. As I mentioned, mathworld is far better at this and it's been around longer than Wikipedia.

Re:The Matrix Calculus You Need for Deep Learning by Sinidir on Friday June 29, 2018 @12:28PM (#17425491)
My uni lectures used to be in the same style as wiki articles. Professor reading from a extremely dense abstract script every lecture and not really explaining anything.

Bad times.

Re:The Matrix Calculus You Need for Deep Learning by cimmanom on Friday June 29, 2018 @05:27AM (#17423422)
Thank you for a super clear explanation that was easy to grok even with no more math background than (extremely rusty) high school calculus.
Re:The Matrix Calculus You Need for Deep Learning by hotwire on Friday June 29, 2018 @08:15AM (#17424032)
yep, these are the kinds of posts on HN that I really appreciate, not the contrarian "well akshually" kind that usually appear.
Re:The Matrix Calculus You Need for Deep Learning by mlevental on Friday June 29, 2018 @10:23AM (#17424671)
what is the name of the first method (fit parabolic surface)?
Re:The Matrix Calculus You Need for Deep Learning by mxwsn on Friday June 29, 2018 @10:58AM (#17424885)
In optimization it's known as Newton's method.

See the third section here for an intuitive image of repeated parabola-fitting. https://ardianumam.wordpress.com/2017/09/27/newtons-method-o...

Wiki: https://en.wikipedia.org/wiki/Newton%27s_method_in_optimizat...

Re:The Matrix Calculus You Need for Deep Learning by mlevental on Friday June 29, 2018 @01:18PM (#17425928)
i feel silly for never realizing before that this was the appropriate geometric interpretation of newton's method.