Do people do it this way? Isn't using index notation + Einstein summation convention way easier and more powerful? You only need to remember two rules: 1. dx_i/dx_k = [i==j] where [i==j] is 0 if i != j and 1 if i == j 2. (AB)_ij = A_ik B_kj You don't even need the second rule if the function you want to differentiate is in index notation in the first place. The example of the other comment: f(x) = x^T A x = x_i A_ij…
I think you got the indices "k" and "j" mixed up in rule 1.
The matrix calculus you need for deep learning (2018)
41–43 of 43 posts
Re: The matrix calculus you need for deep learning (2018)
#42Earlier quoted context omitted.
I think it conceptually helps a lot to distinguish between row and column vectors, even if they are coalesce in any production code you might write. (0a) An (nxm) matrix A represents a linear transformation f(x)=Ax from R^m -> R^n (0b) A linear transformation f(x) = Ax is its own derivative, f'(x) = Ax (3) The derivative of a function f : R^m -> R^n is a linear transformation with the same "type" R^m -> R^n as the or…
> (0b) A linear transformation f(x) = Ax is its own derivative, f'(x) = Ax f'(x) is just A , not Ax, f'(x) != f(x)
It's unfortunate that the connection between matrices and linear transformations, and thereby between derivatives and linear transformations, is not adequately emphasized in the math courses that most people take.
The derivative (or differential, or total derivative) of a function f : R^m -> R^n at a point x ∈ R^m is defined, formally, to be a linear transformation A : R^n -> R^m such that
|| f(x+h) - (f(x) + A(h)) ||
lim ------------------------ = 0
h->0 ||h||
Where ||.|| indicates a vector norm that measures the magnitude of its argument. Unpacking a bit, notice that> h is a vector in R^m
> f(x+h) is the exact value of f at x+h
> f(x)+A(h) is a linear approximation to f(x+h), using x as the base point and A as the linear approximator
So this just a formal way of saying that the dervative A should be a good linear approximation to f.
Every linear transformation has a corresponding matrix, and every matrix corresponds to a linear transformation (with respect to a choice of basis). So, when we say "the derivative of f at x is the matrix A", we really mean that "the derivative of f at x is the linear transformation represented by the matrix A".
EDIT: In response to the parent poster, who has dug their heels in by posting a now-dead rant in reply to this post, I encourage you to refer to a copy of Rudin, "Principles of Mathematical Analysis", for a rigorous treatment of derivatives. See also: representation theory and group actions.
Re: The matrix calculus you need for deep learning (2018)
#43Earlier quoted context omitted.
> (0b) A linear transformation f(x) = Ax is its own derivative, f'(x) = Ax f'(x) is just A , not Ax, f'(x) != f(x)
(I vouched for this comment since it exposes a common misconception people have about derivatives, and I'd rather reply than have it buried) It's unfortunate that the connection between matrices and linear transformations, and thereby between derivatives and linear transformations, is not adequately emphasized in the math courses that most people take. The derivative (or differential, or total derivative) of a functi…
f'(x) is just A , not Ax,
f'(x) != f(x)
Just as in 1-d you approximate a function when using just first order terms by:
f(x+h)= f(x) + f'(x)*h
> So this just a formal way of saying that the dervative A should be a good linear approximation to f.
This is incorrect. The derivative does not give an approximation to the function. You say it yourself in the next paragraph:
f(x)+Ah is a linear approximation to f(x+h)
So not just A. This makes as much sense as saying that 1 is the approximation of e^x because it is one of the terms of the expansion.
I suggest you to reword your comment or make a review of these basic concepts.