Skip to content

Latest commit

 

History

History
343 lines (172 loc) · 6.15 KB

cs-229-linear-algebra.md

File metadata and controls

343 lines (172 loc) · 6.15 KB

Linear Algebra and Calculus translation [webpage]


1. Linear Algebra and Calculus refresher


2. General notations


3. Definitions


4. Vector ― We note x∈Rn a vector with n entries, where xi∈R is the ith entry:


5. Matrix ― We note A∈Rm×n a matrix with m rows and n columns, where Ai,j∈R is the entry located in the ith row and jth column:


6. Remark: the vector x defined above can be viewed as a n×1 matrix and is more particularly called a column-vector.


7. Main matrices


8. Identity matrix ― The identity matrix I∈Rn×n is a square matrix with ones in its diagonal and zero everywhere else:


9. Remark: for all matrices A∈Rn×n, we have A×I=I×A=A.


10. Diagonal matrix ― A diagonal matrix D∈Rn×n is a square matrix with nonzero values in its diagonal and zero everywhere else:


11. Remark: we also note D as diag(d1,...,dn).


12. Matrix operations


13. Multiplication


14. Vector-vector ― There are two types of vector-vector products:


15. inner product: for x,y∈Rn, we have:


16. outer product: for x∈Rm,y∈Rn, we have:


17. Matrix-vector ― The product of matrix A∈Rm×n and vector x∈Rn is a vector of size Rn, such that:


18. where aTr,i are the vector rows and ac,j are the vector columns of A, and xi are the entries of x.


19. Matrix-matrix ― The product of matrices A∈Rm×n and B∈Rn×p is a matrix of size Rn×p, such that:


20. where aTr,i,bTr,i are the vector rows and ac,j,bc,j are the vector columns of A and B respectively


21. Other operations


22. Transpose ― The transpose of a matrix A∈Rm×n, noted AT, is such that its entries are flipped:


23. Remark: for matrices A,B, we have (AB)T=BTAT


24. Inverse ― The inverse of an invertible square matrix A is noted A−1 and is the only matrix such that:


25. Remark: not all square matrices are invertible. Also, for matrices A,B, we have (AB)−1=B−1A−1


26. Trace ― The trace of a square matrix A, noted tr(A), is the sum of its diagonal entries:


27. Remark: for matrices A,B, we have tr(AT)=tr(A) and tr(AB)=tr(BA)


28. Determinant ― The determinant of a square matrix A∈Rn×n, noted |A| or det(A) is expressed recursively in terms of A∖i,∖j, which is the matrix A without its ith row and jth column, as follows:


29. Remark: A is invertible if and only if |A|≠0. Also, |AB|=|A||B| and |AT|=|A|.


30. Matrix properties


31. Definitions


32. Symmetric decomposition ― A given matrix A can be expressed in terms of its symmetric and antisymmetric parts as follows:


33. [Symmetric, Antisymmetric]


34. Norm ― A norm is a function N:V⟶[0,+∞[ where V is a vector space, and such that for all x,y∈V, we have:


35. N(ax)=|a|N(x) for a scalar


36. if N(x)=0, then x=0


37. For x∈V, the most commonly used norms are summed up in the table below:


38. [Norm, Notation, Definition, Use case]


39. Linearly dependence ― A set of vectors is said to be linearly dependent if one of the vectors in the set can be defined as a linear combination of the others.


40. Remark: if no vector can be written this way, then the vectors are said to be linearly independent


41. Matrix rank ― The rank of a given matrix A is noted rank(A) and is the dimension of the vector space generated by its columns. This is equivalent to the maximum number of linearly independent columns of A.


42. Positive semi-definite matrix ― A matrix A∈Rn×n is positive semi-definite (PSD) and is noted A⪰0 if we have:


43. Remark: similarly, a matrix A is said to be positive definite, and is noted A≻0, if it is a PSD matrix which satisfies for all non-zero vector x, xTAx>0.


44. Eigenvalue, eigenvector ― Given a matrix A∈Rn×n, λ is said to be an eigenvalue of A if there exists a vector z∈Rn∖{0}, called eigenvector, such that we have:


45. Spectral theorem ― Let A∈Rn×n. If A is symmetric, then A is diagonalizable by a real orthogonal matrix U∈Rn×n. By noting Λ=diag(λ1,...,λn), we have:


46. diagonal


47. Singular-value decomposition ― For a given matrix A of dimensions m×n, the singular-value decomposition (SVD) is a factorization technique that guarantees the existence of U m×m unitary, Σ m×n diagonal and V n×n unitary matrices, such that:


48. Matrix calculus


49. Gradient ― Let f:Rm×n→R be a function and A∈Rm×n be a matrix. The gradient of f with respect to A is a m×n matrix, noted ∇Af(A), such that:


50. Remark: the gradient of f is only defined when f is a function that returns a scalar.


51. Hessian ― Let f:Rn→R be a function and x∈Rn be a vector. The hessian of f with respect to x is a n×n symmetric matrix, noted ∇2xf(x), such that:


52. Remark: the hessian of f is only defined when f is a function that returns a scalar


53. Gradient operations ― For matrices A,B,C, the following gradient properties are worth having in mind:


54. [General notations, Definitions, Main matrices]


55. [Matrix operations, Multiplication, Other operations]


56. [Matrix properties, Norm, Eigenvalue/Eigenvector, Singular-value decomposition]


57. [Matrix calculus, Gradient, Hessian, Operations]