Skip to main content
QUICK REVIEW

[Paper Review] The Matrix Calculus You Need For Deep Learning

Terence Parr, Jeremy Howard|arXiv (Cornell University)|Feb 5, 2018
Neural Networks and ApplicationsComputer Science12 citations
TL;DR

This paper provides a concise, accessible guide to the matrix calculus essential for understanding deep learning training, focusing on derivatives of neural network components like weights and biases. It derives key rules—such as the vector chain rule and Jacobian computation—using intuitive explanations and practical examples, enabling researchers to grasp backpropagation mechanics without advanced math background.

ABSTRACT

This paper is an attempt to explain all the matrix calculus you need in order to understand the training of deep neural networks. We assume no math knowledge beyond what you learned in calculus 1, and provide links to help you refresh the necessary math where needed. Note that you do not need to understand this material before you start learning to train and use deep learning in practice; rather, this material is for those who are already familiar with the basics of neural networks, and wish to deepen their understanding of the underlying math. Don't worry if you get stuck at some point along the way---just go back and reread the previous section, and try writing down and working through some examples. And if you're still stuck, we're happy to answer your questions in the Theory category at forums.fast.ai. Note: There is a reference section at the end of the paper summarizing all the key matrix calculus rules and terminology discussed here. See related articles at http://explained.ai

Motivation & Objective

  • To bridge the gap between basic calculus and the matrix calculus required for deep learning, particularly for understanding backpropagation.
  • To demystify matrix calculus for practitioners who have basic knowledge of neural networks but lack familiarity with vector and matrix derivatives.
  • To provide a self-contained, intuitive explanation of core matrix calculus rules used in training deep neural networks.
  • To serve as a reference for researchers and students seeking to understand the mathematical underpinnings of automatic differentiation in deep learning frameworks.
  • To reduce reliance on rote memorization by deriving key rules step-by-step using foundational concepts from calculus and linear algebra.

Proposed method

  • Uses scalar calculus as a foundation, gradually extending to vector and matrix derivatives through intuitive generalizations.
  • Introduces the Jacobian and gradient as central tools for organizing partial derivatives of vector-valued functions.
  • Applies the vector chain rule to compute derivatives of composite functions common in neural networks, such as loss functions with ReLU activations.
  • Employs consistent notation (numerator layout) and emphasizes clarity over mathematical formality to improve accessibility.
  • Derives the gradient of the loss function with respect to weights and biases using element-wise operations, reductions, and scalar expansion rules.
  • Provides a reference section summarizing key identities and rules, including those for element-wise operations, scalar expansion, and vector reductions.

Experimental results

Research questions

  • RQ1How can scalar calculus rules be extended to compute derivatives of vector- and matrix-valued functions in deep learning?
  • RQ2What are the correct matrix calculus rules for computing gradients in multi-layer neural networks with non-linear activations?
  • RQ3How does the vector chain rule simplify the computation of gradients in deep networks with multiple parameters?
  • RQ4What is the role of Jacobians and gradients in backpropagation, and how are they computed efficiently?
  • RQ5How can matrix calculus be taught in a way that is accessible to those with only a basic calculus background?

Key findings

  • The paper successfully derives the gradient of the loss function with respect to both weights and biases in a single-neuron network using matrix calculus.
  • It demonstrates that the vector chain rule enables efficient backpropagation through complex computational graphs common in deep learning.
  • The authors show that element-wise operations and reductions (e.g., sum) follow consistent derivative rules that generalize naturally from scalar calculus.
  • The paper establishes that scalar expansion and Jacobian organization are essential for handling non-uniform derivative dimensions in neural network layers.
  • The reference section provides a comprehensive, practical summary of matrix calculus rules, making it a reliable on-the-job resource for researchers and practitioners.
  • The approach enables readers to understand and implement backpropagation from first principles, even without prior exposure to advanced matrix calculus.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.