Skip to content

Module 01

Anurag Prasad edited this page Nov 7, 2026 · 10 revisions

Module 01: Linear Algebra, Vector Spaces and Tensor Mathematics

Level: Foundation
Status: Planned — navigation and lesson specifications

Module purpose

This module is a self-contained learning unit within the larger Deep Learning curriculum. Its purpose is to build understanding from motivation and prerequisites through mathematical reasoning, implementation and critical evaluation.

Introduction and conceptual foundation

Deep learning represents examples, parameters and intermediate computations as vectors, matrices and higher-order tensors. Linear algebra explains how layers transform these representations, while vector spaces, rank and decompositions describe what information a transformation can preserve or discard. Shape reasoning is essential: every matrix product and tensor operation has dimensional requirements.

How the ideas develop

Begin with scalar and vector arithmetic, then matrix multiplication and norms. Continue to linear independence, basis, rank, eigenvalues and singular-value decomposition. Finally connect these ideas to batched dense layers, convolutional tensors and attention operations.

What the reader should be able to explain

By the end of this module, a reader should be able to define its central objects, explain the motivation behind its main methods, interpret the governing equations, work through a small example, and identify assumptions and limitations. The goal is understanding the mechanism—not memorizing a list of terms.

Learning outcomes

  • Explain weight matrices as learned transformations.
  • Track shapes through dense, convolution and attention operations.
  • Explain why rank, norms and SVD matter.

Navigation

Focused submodules and topic extensions

Each page below isolates a specific concept or closely related group of concepts. The page isolates a specific concept or closely related group of concepts for focused study.

Topic-wise lessons

  1. Module-01-Lesson-01
  2. Module-01-Lesson-02
  3. Module-01-Lesson-03
  4. Module-01-Lesson-04
  5. Module-01-Lesson-05
  6. Module-01-Lesson-06
  7. Module-01-Lesson-07
  8. Module-01-Lesson-08
  9. Module-01-Lesson-09

How to complete this module

  1. Study the lessons in prerequisite order.
  2. Write a notation sheet and derive central equations.
  3. Solve at least one hand-worked example per major mechanism.
  4. Implement core operations where appropriate.
  5. Verify outputs and gradients.
  6. Complete conceptual and coding exercises.
  7. Record limitations and research extensions.

Completion status

  • Conceptual understanding
  • Mathematical derivations
  • Worked numerical examples
  • NumPy implementation (where applicable)
  • PyTorch implementation (where applicable)
  • Tests and numerical verification
  • Experiments and interpretation
  • Revision and self-assessment

Technical chapter

1. Why this area matters

Linear algebra is the language used to represent data, parameters and transformations in neural networks. A vector may represent one example, a matrix a batch or a learned linear map, and a higher-order tensor a batch of images, sequences or feature maps. Shape discipline is not cosmetic: most implementation bugs in deep learning are dimension, broadcasting or layout errors.

2. Core mathematical formulation

A dense layer for a batch of B examples is commonly written as

$$ Y = XW + \mathbf{1}b^\top, \qquad X\in\mathbb{R}^{B\times d_{\mathrm{in}}}, \quad W\in\mathbb{R}^{d_{\mathrm{in}}\times d_{\mathrm{out}}}. $$

The Euclidean norm and Frobenius norm are

$$ |x|_2 = \sqrt{\sum_i x_i^2}, \qquad |A|_F = \sqrt{\sum_{i,j} A_{ij}^2}. $$

A rank-r approximation from the singular value decomposition is $A=U\Sigma V^\top$ and $A_r=U_r\Sigma_rV_r^\top$.

3. Worked reasoning example

Let a batch contain 32 vectors with 10 features and let a layer produce 4 outputs. Then X has shape (32, 10), W has shape (10, 4), and b has shape (4,). The result has shape (32, 4). A transpose error such as using W with shape (4, 10) should be caught before training.

4. Conceptual flow

flowchart LR
  A[Raw examples] --> B[Tensor and shape]
  B --> C[Linear map XW]
  C --> D[Bias broadcast]
  D --> E[Output features]
  E --> F[Check shape and numerical result]
Loading

5. Implementation and verification

In NumPy, assert X.shape[1] == W.shape[0] before multiplication. In PyTorch, inspect .shape, .dtype, .device, and use torch.testing.assert_close to compare a hand calculation with the framework result.

6. Common failure modes and misconceptions

Do not confuse a tensor's rank (number of axes) with matrix rank (dimension of its column space). Broadcasting can silently produce a valid but unintended shape. A transpose changes orientation; it is not a general substitute for reshaping. Eigenvectors are useful for square operators, while SVD applies to rectangular matrices as well.

7. Advanced and research directions

Connect matrix rank to bottlenecks, low-rank adapters and compression; connect singular values to conditioning and gradient sensitivity. Study numerical precision and mixed-precision accumulation when dimensions become large.

8. Suggested practical assignment

  1. Reproduce the smallest mathematical example by hand.
  2. Implement the central operation using NumPy.
  3. Implement the same operation using PyTorch.
  4. Compare outputs and gradients with numerical tolerances.
  5. Change one assumption or hyperparameter and document what changes.
  6. Record environment, random seed, data split, compute budget and limitations.

9. Completion criteria

  • Explain the motivation and assumptions without notes.
  • Derive the principal equations and define every symbol.
  • Complete at least one worked numerical example.
  • Trace tensor shapes through the computation.
  • Implement and test the central mechanism.
  • Explain at least two failure modes.
  • Read one primary paper and summarize its contribution and limitations.

Content status: This page now contains a technical chapter and a practical learning specification. The linked lesson pages provide focused subtopic treatment; experiments are not claimed complete until their result logs are added.

🎓 Deep Learning Hub

🏠 Home · 🗺️ Curriculum · 🧭 Learning paths

❓ Question bank · 📖 Glossary · 📚 References

Jump to module:

01 02 03 04 05 06 07 08 09 10 11 12

13 14 15 16 17 18 19 20 21 22 23 24

Part 1 · Mathematical foundations
Part 2 · Neural network fundamentals
Part 3 · Training deep networks
Part 4 · Core architectures
Part 5 · Representation and generative learning
Part 6 · Specialised, modern and responsible deep learning
Reference and meta

Clone this wiki locally