Course or collection
Matrix Calculus for Machine Learning and Beyond
MIT OpenCourseWare · 17 catalogue entries
MIT OpenCourseWare · January IAP 2023
Original course and syllabus ↗MIT 18.S096 Matrix Calculus For Machine Learning And Beyond, IAP 2023
Lecture 1 Part 1: Introduction and Motivation
Description: What is matrix calculus, and why do we need to go beyond single variable and multivariable calculus? Instructors: Alan Edelman, Steven G. Johnson
Lecture 1 Part 2: Derivatives as Linear Operators
Description: The key to generalizing derivatives is to realize that they are linear operators, relating small changes in a function’s input to small changes in the output. Instructors: Alan Edelman, Steven G. Johnson
Lecture 2 Part 1: Derivatives in Higher Dimensions: Jacobians and Matrix Functions
Description: Derivatives as linear operators give a fresh perspective on multivariable calculus, gradients, and Jacobian matrices; but we can now generalize to matrix functions. Instructors: Alan Edelman, Steven G. Johnson
Lecture 2 Part 2: Vectorization of Matrix Functions
Description: We can view matrix functions (matrix inputs/outputs) as “ordinary” multivariable calculus by “vectorizing” a matrix into a column vector. Instructors: Alan Edelman, Steven G. Johnson
Lecture 3 Part 1: Kronecker Products and Jacobians
Description: Matrix-function derivatives are linear operators on matrices, but they can often be turned into “ordinary” Jacobian matrices using Kronecker products. Instructors: Alan Edelman, Steven G. Johnson
Lecture 3 Part 2: Finite-Difference Approximations
Description: Finite difference approximations are useful tools, e.g. to check analytical derivatives, but lead to numerical analysis to understand truncation and roundoff errors. Instructors: Alan Edelman, Steven G. Johnson
Lecture 4 Part 1: Gradients and Inner Products in Other Vector Spaces
Description: We can generalize the concept of a “gradient” beyond column vectors, e.g. to “matrix gradients,” if we first generalize the concept of inner product. Instructors: Alan Edelman, Steven G. Johnson
Lecture 4 Part 2: Nonlinear Root Finding, Optimization, and Adjoint Gradient Methods
Description: Nonlinear root finding by Newton’s method and optimization by gradient descent. “Adjoint” methods (reverse-mode/backpropagation) let us find gradients efficiently for large-scale engineering optimization. Instructors: Alan Edelman, Steven G. Johns
Lecture 5 Part 1: Derivative of Matrix Determinant and Inverse
Description: The first ~6 minutes are on the topic Norms and Derivatives: Why a norm of the input and output are needed to define a derivative. Now we can find the “matrix gradient” of the determinant function (leading to the “adjugate” matrix), and the “Jacob
Lecture 5 Part 2: Forward Automatic Differentiation via Dual Numbers
Description: One simple way to automatically differentiate (AD) computer programs (in “forward mode”) is to define a new kind of number that carries both value and derivative information: dual numbers. A few lines of Julia let us build an AD system! Instructor
Lecture 5 Part 3: Differentiation on Computational Graphs
Description: A very general way to think about the chain rule is to view computations as flowing through “graphs” consisting of nodes (intermediate values) connected by edges (functions acting on those values). When we propagate derivatives through the graph f
Lecture 6 Part 1: Adjoint Differentiation of ODE Solutions
Description: Many systems are modeled by ordinary differential equations (ODEs), and often you want the derivative of the ODE solution with respect to parameters of the equations. An efficient way to do this is often to solve a second “adjoint” ODE. Instructor
Lecture 6 Part 2: Calculus of Variations and Gradients of Functionals
Description: A “functional” F[u] takes a function u(x) and returns a number (e.g. by integrating), and since functions are perfectly good normed vector spaces we can define derivatives F′ with respect to functions u! This is called “calculus of variations.” In
Lecture 7 Part 1: Derivatives of Random Functions
Description: Even if a function f is stochastic (has random numbers in it), we can still define a derivative “on average” (whose expectation value is the derivative of the expectation value of f), for example, for stochastic gradient descent in machine learnin
Lecture 7 Part 2: Second Derivatives, Bilinear Forms, and Hessian Matrices
Description: First derivatives are linear operators, so second derivatives are bilinear forms, sometimes called “Hessians” (especially for scalar-valued functions of column vectors, where the Hessian is simply a symmetric matrix). Instructors: Alan Edelman, St
Lecture 8 Part 1: Derivatives of Eigenproblems
Description: To differentiate eigenvectors and eigenvalues, we first consider derivatives with constraints, such as derivatives on a circle or derivatives involving unitary matrices. Instructors: Alan Edelman, Steven G. Johnson
Lecture 8 Part 2: Automatic Differentiation on Computational Graphs
Description: Complicated computational processes can be expressed as “graphs” of computational steps that flow from inputs to outputs. Forward- and reverse-mode automatic differentiation (AD) traverse in opposite directions, giving very different algorithms. I