O'Reilly logo
live online training icon Live Online training

Machine Learning Foundations: Linear Algebra II: Matrix Operations

Use Tensors in Python to Solve Systems of Equations and Reduce Dimensionality

Jon Krohn

The Machine Learning Foundations series of online trainings provides a comprehensive overview of all of the subjects -- mathematics, statistics, and computer science -- that underlie contemporary machine learning techniques, including deep learning and other artificial intelligence approaches.

All of the classes in the series bring theory to life through the combination of vivid full-color illustrations, straightforward Python examples within hands-on Jupyter notebook demos, and comprehension exercises with fully-worked solutions.

The focus is on providing you with a practical, functional understanding of the content covered. Context will be given for each topic, highlighting its relevance to machine learning. You will be better-positioned to understand cutting-edge machine learning papers and you will be provided with resources for digging even deeper into topics that pique your curiosity.

The eight classes in the series are organized into four couplets:

Linear Algebra



Computer Science

The content in the second class of each couplet follows directly from the content of the first, however you’re most welcome to pick and choose between any of the individual classes based on your particular interests or your existing familiarity with the material. (Note that at any given time, only a subset of these courses will be scheduled and open for registration. To be pushed notifications of upcoming classes in the series, sign up for the instructor's email newsletter at jonkrohn.com.)

This class, Linear Algebra II: Matrix Operations, builds on the basics of linear algebra. It is essential because these intermediate-level manipulations of tensors lie at the heart of most machine learning approaches and are especially predominant in deep learning. Through the measured exposition of theory paired with interactive examples, you’ll develop an understanding of how linear algebra is used to solve for unknown values in high-dimensional spaces as well as to reduce the dimensionality of complex spaces. The content covered in this class is itself foundational for several other classes in the Machine Learning Foundations series, especially Probability & Information Theory and Optimization.

What you'll learn-and how you can apply it

  • Develop a geometric intuition of what’s going on beneath the hood of machine learning algorithms, including those used for deep learning.
  • Be able to more intimately grasp the details of machine learning papers as well as all of the other subjects that underlie ML, including calculus, statistics, and optimization algorithms.
  • Reduce the dimensionalty of complex spaces down to their most informative elements with techniques such as eigendecomposition, singular value decomposition, and principal components analysis.

This training course is for you because...

  • You use high-level software libraries (e.g., scikit-learn, Keras, TensorFlow) to train or deploy machine learning algorithms, and would now like to understand the fundamentals underlying the abstractions, enabling you to expand your capabilities
  • You’re a software developer who would like to develop a firm foundation for the deployment of machine learning algorithms into production systems
  • You’re a data scientist who would like to reinforce your understanding of the subjects at the core of your professional discipline
  • You’re a data analyst or A.I. enthusiast who would like to become a data scientist or data/ML engineer, and so you’re keen to deeply understand the field you’re entering from the ground up (very wise of you!)


  • All code demos will be in Python so experience with it or another object-oriented programming language would be helpful for following along with the hands-on examples.

Materials, downloads, or Supplemental Content needed in advance

  • During class, we’ll work on Jupyter notebooks interactively in the cloud via Google Colab. This requires zero setup and instructions will be provided in class.


  • Familiarity with the basics of linear algebra (e.g., the topics covered in Chapter 4 of Hadrien Jean’s book) will make the class easier to follow along with.

About your instructor

  • Jon Krohn is Chief Data Scientist at the machine learning company untapt. He authored the 2019 book Deep Learning Illustrated, an instant #1 bestseller that was translated into six languages. Jon’s also the presenter of dozens of hours of popular video tutorials such as Deep Learning with TensorFlow, Keras, and PyTorch. And he’s renowned for his compelling lectures, which he offers in-person at Columbia University, New York University, and the NYC Data Science Academy. Jon holds a PhD in neuroscience from Oxford and has been publishing on machine learning in leading academic journals since 2010.


The timeframes are only estimates and may vary according to how the class is progressing

Segment 1: Review of Tensor Properties (70 min)

  • Tensors
  • Basic Tensor Operations
  • Multiplying Matrices and Vectors
  • Identity and Inverse Matrices
  • Linear Dependence and Span
  • Norms
  • The Relationship of Norms to Objective Functions
  • Special Matrices: Diagonal, Symmetric, and Orthogonal
  • Q&A and Break

Segment 2: Eigendecomposition (70 min)

  • Eigenvectors
  • Eigenvalues
  • Matrix Decomposition
  • Q&A and Break

Segment 3: Matrix Properties & Operations for Machine Learning (70 min)

  • Singular Value Decomposition (SVD)
  • The Moore-Penrose Pseudoinverse
  • The Trace Operator
  • The Determinant
  • Principal Components Analysis (PCA): A Simple Machine Learning Algorithm
  • Resources for Further Study of Linear Algebra
  • Final Exercises and Q&A