News for hackers. Stuff that matters.
Re:Matrix Calculus for Deep Learning by calebh on Tuesday January 30, 2018 @04:08PM (#16269040)
Fortunately there is a website now capable of doing matrix calculus! http://www.matrixcalculus.org

Mathematica doesn't seem to be able to do matrix calculus, which surprised me quite a bit.

Re:Matrix Calculus for Deep Learning by BucketSort on Tuesday January 30, 2018 @04:14PM (#16269101)
Indeed, most tools surprisingly lack this ability. I was shocked when I needed to break my calculations down to a piece-wise form when doing matrix calc with SymPy.
Re:Matrix Calculus for Deep Learning by improbable22 on Tuesday January 30, 2018 @05:03PM (#16269505)
Mathematica can absolutely do all of this! D[ matrix ,x] ... or things like this:

f[x_,y_] := x^2 + Sin[y]

vars={x,y};

Table[ D[f[x,y],var1, var2], {var1,vars}, {var2,vars}] // MatrixForm

Re:Matrix Calculus for Deep Learning by SoerenL on Tuesday January 30, 2018 @05:14PM (#16269600)
But how do you compute the derivative of x'Ax in Mathematica (x being a vector and A being a matrix)? What you have pointed out is only scalar derivatives, if I am not mistaken here.
Re:Matrix Calculus for Deep Learning by improbable22 on Tuesday January 30, 2018 @05:27PM (#16269668)
Like this, perhaps?

A = {{1,2},{3,4}}

vec = {x^2, x^3}

D[vec.A.vec, x]

Or perhaps like this, again the table of derivatives:

xvec = {x1,x2}

Table[ D[xvec.A.xvec,x] ,{x,xvec}]

(all untested... one typo caught...)

Re:Matrix Calculus for Deep Learning by calebh on Tuesday January 30, 2018 @06:18PM (#16270011)
Mathematica can definitely compute the derivatives if you fix the size of the matrix. This isn't very useful if you're trying to compute the derivative of an expression with arbitrary sized matrices.
Re:Matrix Calculus for Deep Learning by improbable22 on Tuesday January 30, 2018 @07:48PM (#16270437)
You can do general matrices too, what do you have in mind?

aa[x_] = {{1, 2}, {3, 4}} x

bb[x_] = {x^2, x^3}

D[ a[x].b[x] , x, x] (* for any suitable tensors *)

% /. {a -> aa, b -> bb}

Re:Matrix Calculus for Deep Learning by claar on Tuesday January 30, 2018 @05:57PM (#16269880)
Re:Matrix Calculus for Deep Learning by parrt on Wednesday January 31, 2018 @01:44PM (#16276353)
Added Link to Wolfram Alpha...
Re:Matrix Calculus for Deep Learning by adyavanapalli on Tuesday January 30, 2018 @04:15PM (#16269106)
Note: This website presumes denominator layout, which is different from what is used in the guide.
Re:Matrix Calculus for Deep Learning by calebh on Tuesday January 30, 2018 @06:20PM (#16270025)
Does the layout matter as long as you're consistent? Do the deep learning libraries presume that you're using a certain layout?
Re:Matrix Calculus for Deep Learning by jph00 on Tuesday January 30, 2018 @08:06PM (#16270510)
The deep learning libraries largely hide all the calculus - it's all automated.
Re:Matrix Calculus for Deep Learning by parrt on Tuesday January 30, 2018 @04:11PM (#16269061)
Wow! Great little calculator. Thanks for pointing us at it.
Re:Matrix Calculus for Deep Learning by calebh on Tuesday January 30, 2018 @06:19PM (#16270021)
You should add a link in the resources section
Re:Matrix Calculus for Deep Learning by parrt on Wednesday January 31, 2018 @01:44PM (#16276356)
Done. Added a link.