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

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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

  10. 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

  11. 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

  12. 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

  13. 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

  14. 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

  15. 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

  16. 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

  17. 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

Add to a playlist