TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Matrix Calculus: Calculate derivatives of matrices

165 pointsby mrv_asuraabout 2 years ago

11 comments

bmc7505about 2 years ago
Sören Laue, creator and first author of this work [1] gave a nice talk [2,3] about it at our reading group not long ago. He also has written about how automatic and symbolic differentiation are essentially equivalent. [4]<p>[1]: <a href="https:&#x2F;&#x2F;papers.nips.cc&#x2F;paper&#x2F;2018&#x2F;file&#x2F;0a1bf96b7165e962e90cb14648c9462d-Paper.pdf" rel="nofollow">https:&#x2F;&#x2F;papers.nips.cc&#x2F;paper&#x2F;2018&#x2F;file&#x2F;0a1bf96b7165e962e90cb...</a><p>[2]: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=IbTRRlPZwgc">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=IbTRRlPZwgc</a><p>[3]: <a href="https:&#x2F;&#x2F;compcalc.github.io&#x2F;public&#x2F;laue&#x2F;tensor_derivatives.pdf" rel="nofollow">https:&#x2F;&#x2F;compcalc.github.io&#x2F;public&#x2F;laue&#x2F;tensor_derivatives.pd...</a><p>[4]: <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;1904.02990.pdf" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;pdf&#x2F;1904.02990.pdf</a>
评论 #35578104 未加载
评论 #35577661 未加载
评论 #35577711 未加载
FabHKabout 2 years ago
Example where it comes in handy: OLS (ordinary least squares).<p>You want to solve Ax = b approximately. So, minimise the two-norm |Ax-b|, or equivalently, |Ax-b|^2, or equivalently (Ax-b)ᵀ(Ax-b) = xᵀAᵀAx - 2xᵀAᵀb + bᵀb.<p>How to minimise it? Easy, take the derivative wrt the vector x and set to zero (the zero vector):<p>2AᵀAx - 2Aᵀb = 0, so x = (AᵀA)⁻¹ Aᵀb.<p>(Note: that&#x27;s the mathematical formulation of the solution, not how you&#x27;d actually compute it.)
评论 #35578846 未加载
eachroabout 2 years ago
Knowing matrix derivatives well is one of those skills that were essential in machine learning 10 years ago. Not so much anymore with the dominance of massive neural networks.
评论 #35576856 未加载
评论 #35577132 未加载
评论 #35577493 未加载
评论 #35579149 未加载
评论 #35577098 未加载
hgibbsabout 2 years ago
The term &quot;matrix derivative&quot; is a bit loaded - you can either mean the derivative of functions with matrix arguments, or functions with vector arguments that have some matrix multiplication terms. Either way, I don&#x27;t really understand what the confusion is about - if you slightly modify the definition of a derivative to be directional (e.g. lim h-&gt;0 (f(X + hA) - f(X))&#x2F;h) then all of this stuff looks the same (vector derivatives, matrix derivatives and so forth). Taking this perspective was very useful during my PhD where I had to work with analytic operator valued functions.
评论 #35578967 未加载
TinkersWabout 2 years ago
That is useful but sure would be even more useful if it let you define functions and call them.<p>Also the output is pretty gross, wish it had an option for a statically typed language.<p>Also wtf? It doesn&#x27;t have sqrt? Have to write it in power form..sigh<p>Also seems to also not grok values with decimal points as the power, so you have to write it as a fraction..sigh..why math people..why?<p>Also why can you only select the output for 1 value at a time? For instance if we have a 3d position, we want gradient for x&#x2F;y&#x2F;z not just 1 of them..
Aardwolfabout 2 years ago
How do you enter the matrix transpose in this tool?<p>In an example they use X&#x27; for transpose and it works.<p>But if I try A&#x27; * A, it either becomes just A * A, or it shows nothing and says &quot; This 4th order tensor cannot be displayed as a matrix. See the documentation section for more details.&quot;<p>The documentation also doesn&#x27;t show how to enter the transpose operator.
keithalewisabout 2 years ago
<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Fréchet_derivative" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Fréchet_derivative</a><p>Doesn&#x27;t this cover all examples presented?
tpoacherabout 2 years ago
I have an annoyance reflex when people talk about things like &quot;the derivative of a matrix&quot;. A matrix is a notational concept, not an object in itself. It makes as much sense to me as saying the derivative of a set, or the derivative of an array (i.e. as opposed to a vector).<p>It should be derivatives &quot;with&quot; matrices, not &quot;of&quot;, in my mind.<p>Not that it matters in practice, but ... if there&#x27;s one field where precision of language matters, it should have been mathematics. So it bothers me.
评论 #35581992 未加载
评论 #35580136 未加载
bobsmoothabout 2 years ago
I didn&#x27;t know matrices had derivatives.
评论 #35577394 未加载
评论 #35577114 未加载
评论 #35576971 未加载
pkoirdabout 2 years ago
Any good Textbooks for this topic?
评论 #35577287 未加载
评论 #35577982 未加载
评论 #35577864 未加载
ameliusabout 2 years ago
How about computing integrals?