Skip to main content

· Translation updated

Modern Artificial Intelligence III — Perceptrons, MLPs, CNNs, and Convolution

A complete ledger of fifteen ECE5992 pages, paragraphs, tables, figures, equations, and handwriting, connecting perceptron learning, XOR, MLP forward passes, Dropout/DropConnect, 1D/2D convolution, boundaries, patch matrices, and PyTorch modules to research through 2026.

한국어 원문

Completeness contract
This article follows all fifteen pages of 4_CH4-Backgrounds for AI(1).pdf. Ledgers cover numbered and unnumbered displayed equations, meaningful inline mathematics, figure equations and numbers, ?, ??, blanks, every table cell, captions, footnotes, references, and legible handwriting. Source blanks and notation issues remain visible; completions and corrections receive separate statuses.

Keep three layers distinct.
Separate the 2025 PDF reconstruction, editorial and mathematical verification, and the research update dated August 18, 2026. Later research does not retroactively rewrite the lecture’s claims.

#Ledger status

  • PDF mapping: 15 of 15 pages
  • Total equation records: 163 (MAI-P3-001–MAI-P3-163)
  • Source equations: 140
  • Displayed-equation explanation cards: 99
  • Equation statuses: source-exact, source-suspect, editorially-completed, corrected-variant
  • Source PDF SHA-256: 2a3855c52d688a79d38e714ab7ef7223dd7a5bc5b46f8385f55da777aa1c78af
  • New SVG/HTML diagrams preserve figure structures, numbers, and relationships without reproducing original images.

#Reconstructing the PDF source

#3. Backgrounds for AI and deep learning

The chapter begins with a single perceptron, then develops multilayer perceptrons (MLPs), convolutional neural networks (CNNs), global/local matrix representations of convolution, and core PyTorch modules.

#3.1 A single perceptron model

A perceptron mathematically simplifies a biological neuron. The lecture relates dendrites, synapses, and firing thresholds to numerical inputs, weights, weighted sums, and activation functions.

Biological neuron

dendritesomaaxonsynapse

Perceptron

x₁x₂xₙΣoutputweightssign / step
Biological neuronPerceptron
Dendrites receive electrical signals from other neurons’ axons.Represent electrical signals as numerical inputs.
Synapses between dendrites and axons modulate signals by different amounts.Model this by multiplying each input by a weight.
Firing occurs when total input exceeds a threshold, and output passes to other neurons.Calculate a weighted sum, apply an activation such as sign, and pass the output to the next perceptron.
PDF p. 1 table, reconstructed. New diagrams and a table preserve both columns’ correspondences and all three explanations without copying the neuron photograph or historical web diagram.

#3.1.1 Linear discriminant

One perceptron learns a linear boundary between two linearly separable classes. A 2D line is y=ax+by=ax+b, where coefficient b, not multiplying a coordinate, is the bias.

An N-dimensional point has coordinates x1,x2,…,xNx_1,x_2,\ldots,x_N, and boundary coefficients are w1,w2,…,wN,bw_1,w_2,\ldots,w_N,b.

Rearranging y=ax+cy=ax+c gives y−ax−c=0y-ax-c=0. A more general two-variable linear boundary takes this form.

Source equation · PDF p. 1

Identify the equation's role and symbols
w1x1+w2x2+b=0w_1x_1+w_2x_2+b=0
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Interactive
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 1 · 3.1.1 Linear discriminant Identifier: MAI-P3-006

The source asks how to rewrite y=ax+c as w₁x₁+w₂x₂+b=0 and leaves ?. The question is preserved, with its completed answer in the editorial layer.

For N-dimensional features, classification uses this hyperplane.

Source equation · PDF p. 2

Identify the equation's role and symbols
∑n=1Nwnxn+b=0\sum_{n=1}^{N}w_nx_n+b=0
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.1 Linear discriminant Identifier: MAI-P3-007

Vector notation is

Source equation · PDF p. 2

Identify the equation's role and symbols
wTx+b=0\mathbf{w}^{\mathsf T}\mathbf{x}+b=0
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.1 Linear discriminant Identifier: MAI-P3-008
, with w∈RN,x∈RN\mathbf{w}\in\mathbb{R}^{N},\quad \mathbf{x}\in\mathbb{R}^{N} a column vector. Here, w is the weight vector and b the bias.

The classifier applies a sign decision rule to linear score g.

Source equation · PDF p. 2

A hyperplane classifier separates classes by a weighted score's sign
d(x)=sign⁡(g(x)),g(x)=wTx+bd(\mathbf{x})=\operatorname{sign}(g(\mathbf{x})),\qquad g(\mathbf{x})=\mathbf{w}^{\mathsf T}\mathbf{x}+b
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.1 Linear discriminant Identifier: MAI-P3-010

Its activation is the threshold-type sign function.

Source equation · PDF p. 2

A hyperplane classifier separates classes by a weighted score's sign
sign⁡(a)={−1,a<0,0,a=0,1,a>0.\operatorname{sign}(a)=\begin{cases}-1,&a<0,\\0,&a=0,\\1,&a>0.\end{cases}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.1 Linear discriminant Identifier: MAI-P3-011
  • The boundary is perpendicular to the weight vector. The PDF writes distance from the origin as b∥w∥2\frac{b}{\lVert\mathbf{w}\rVert_2}.
  • The PDF writes distance from point x to the boundary as g(x)∥w∥2\frac{g(\mathbf{x})}{\lVert\mathbf{w}\rVert_2}.
  • On the boundary, g(x)=0g(\mathbf{x})=0; on the positive side indicated by w, g(x)>0g(\mathbf{x})>0; on the opposite side, g(x)<0g(\mathbf{x})<0.

Let the linearly separable training set be D={(x1,y1),…,(xM,yM)}\mathcal{D}=\{(\mathbf{x}_1,y_1),\ldots,(\mathbf{x}_M,y_M)\}. Correct classification of every sample expands classwise as follows.

Source equation · PDF p. 2

Identify the equation's role and symbols
(ym=1 ∧ g(xm)>0) or (ym=−1 ∧ g(xm)<0),∀m\bigl(y_m=1\ \wedge\ g(\mathbf{x}_m)>0\bigr)\ \text{or}\ \bigl(y_m=-1\ \wedge\ g(\mathbf{x}_m)<0\bigr),\quad \forall m
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.1 Linear discriminant Identifier: MAI-P3-018

This compresses into a zero-empirical-risk condition.

Source equation · PDF p. 2

Identify the equation's role and symbols
ym g(xm)>0,∀my_m\,g(\mathbf{x}_m)>0,\quad \forall m
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.1 Linear discriminant Identifier: MAI-P3-019

#3.1.2 Perceptron learning by gradient descent

The initial learning model starts from a necessary and sufficient condition for zero empirical risk.

Source equation · PDF p. 2

A hyperplane classifier separates classes by a weighted score's sign
ym(wTxm+b)>0,∀my_m\bigl(\mathbf{w}^{\mathsf T}\mathbf{x}_m+b\bigr)>0,\quad \forall m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-020

The lecture first constructs reward maximization by increasing the sum of all signed scores.

Source equation · PDF p. 2

A hyperplane classifier separates classes by a weighted score's sign
arg max⁡w,b∑m=1Mym(wTxm+b)\operatorname*{arg\,max}_{\mathbf{w},b}\sum_{m=1}^{M}y_m\bigl(\mathbf{w}^{\mathsf T}\mathbf{x}_m+b\bigr)
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-021

It then writes the equivalent loss-minimization problem.

Source equation · PDF p. 2 · Eq. (1)

A hyperplane classifier separates classes by a weighted score's sign
arg min⁡w,bL(w,b),L(w,b)≜−∑m=1Mym(wTxm+b)\operatorname*{arg\,min}_{\mathbf{w},b}\mathcal{L}(\mathbf{w},b),\qquad \mathcal{L}(\mathbf{w},b)\triangleq-\sum_{m=1}^{M}y_m\bigl(\mathbf{w}^{\mathsf T}\mathbf{x}_m+b\bigr)
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · Eq. (1) · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-022

Lecture annotation — PDF p. 2
The sketch shows w perpendicular to the boundary, with perpendicular distance normalized by ‖w‖. The notation No training error appears beside the signed-margin condition. Other small notes lack sufficient context and remain uncertain to read.

Applying gradient descent to equation (1) requires derivatives with respect to w and b. The source leaves both as ??.

Source notation requires review · PDF p. 3

A gradient describes the direction and rate of loss change
∂L(w,b)∂w=??\frac{\partial\mathcal{L}(\mathbf{w},b)}{\partial\mathbf{w}}=\text{??}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How much does the objective increase or decrease when each parameter increases?

Key idea

Collect partial derivatives into a vector and move in the opposite direction during minimization.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Choose the differentiation variable

    Treat other variables as constants.

  2. 2

    Apply sum, product, and chain rules

    For composition, multiply the outer derivative by the inner derivative.

  3. 3

    Collect partial derivatives into one vector

    ∇f=[∂f/∂x1,…,∂f/∂xN]T\nabla f=[\partial f/\partial x_1,\ldots,\partial f/\partial x_N]^T
  4. 4

    Substitute current values

    Obtain numerical gradient magnitudes and signs.

Worked example

Work through the numbers — Gradient of a one-dimensional loss

The loss squares distance from target value 3.

  1. 1

    Function

    f(w)=(w−3)2f(w)=(w-3)^2
  2. 2

    Derivative

    f′(w)=2(w−3)f'(w)=2(w-3)
  3. 3

    Substitute w=5

    f′(5)=2(5−3)=4f'(5)=2(5-3)=4

Result: The positive gradient 4 means decreasing w reduces loss.

Sanity check

Checks
  • The gradient and parameter vectors must have matching lengths.
  • A constant term has derivative zero.

Symbols

Symbols used in this equation
SymbolMeaning
w\mathbf{w}Learned weight vector
∂\partialPartial derivative with respect to a particular variable
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-023

Source notation requires review · PDF p. 3

A gradient describes the direction and rate of loss change
∂L(w,b)∂b=??\frac{\partial\mathcal{L}(\mathbf{w},b)}{\partial b}=\text{??}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How much does the objective increase or decrease when each parameter increases?

Key idea

Collect partial derivatives into a vector and move in the opposite direction during minimization.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Choose the differentiation variable

    Treat other variables as constants.

  2. 2

    Apply sum, product, and chain rules

    For composition, multiply the outer derivative by the inner derivative.

  3. 3

    Collect partial derivatives into one vector

    ∇f=[∂f/∂x1,…,∂f/∂xN]T\nabla f=[\partial f/\partial x_1,\ldots,\partial f/\partial x_N]^T
  4. 4

    Substitute current values

    Obtain numerical gradient magnitudes and signs.

Worked example

Work through the numbers — Gradient of a one-dimensional loss

The loss squares distance from target value 3.

  1. 1

    Function

    f(w)=(w−3)2f(w)=(w-3)^2
  2. 2

    Derivative

    f′(w)=2(w−3)f'(w)=2(w-3)
  3. 3

    Substitute w=5

    f′(5)=2(5−3)=4f'(5)=2(5-3)=4

Result: The positive gradient 4 means decreasing w reduces loss.

Sanity check

Checks
  • The gradient and parameter vectors must have matching lengths.
  • A constant term has derivative zero.

Symbols

Symbols used in this equation
SymbolMeaning
w\mathbf{w}Learned weight vector
∂\partialPartial derivative with respect to a particular variable
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-024

It then gives these two updates.

Source equation · PDF p. 3

A hyperplane classifier separates classes by a weighted score's sign
w(i+1)=w(i)+α∑m=1Mymxm\mathbf{w}^{(i+1)}=\mathbf{w}^{(i)}+\alpha\sum_{m=1}^{M}y_m\mathbf{x}_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
α\alphaLearning rate, mixture coefficient, or dual coefficient
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-025

Source equation · PDF p. 3

A hyperplane classifier separates classes by a weighted score's sign
b(i+1)=b(i)+α∑m=1Mymb^{(i+1)}=b^{(i)}+\alpha\sum_{m=1}^{M}y_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
α\alphaLearning rate, mixture coefficient, or dual coefficient
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-026

The iteration index is i≥0i\ge 0; initial values w(0), b(0)\mathbf{w}^{(0)},\ b^{(0)} are chosen arbitrarily.

  • Linear separability ensures at least one pair (w,b) satisfying L(w,b)<0\mathcal{L}(\mathbf{w},b)<0.
  • The lecture explains that any solution attaining an equal or smaller value suffices for this gradient-descent objective.

But equation (1) is unbounded below. Once loss is negative, positive scaling of w or b can yield L(w,b)→−∞\mathcal{L}(\mathbf{w},b)\to-\infty, making the objective numerically unsuitable.

The modified model focuses only on misclassified points, defining an error set each iteration.

Source notation requires review · PDF p. 3

A hyperplane classifier separates classes by a weighted score's sign
E={xm:ym(wTxm+b)<0}\mathcal{E}=\{\mathbf{x}_m:y_m(\mathbf{w}^{\mathsf T}\mathbf{x}_m+b)<0\}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-030

Summing loss only over that set gives equation (2).

Source equation · PDF p. 3 · Eq. (2)

A hyperplane classifier separates classes by a weighted score's sign
LE(w,b)=−∑xm∈Eym(wTxm+b)\mathcal{L}_{\mathcal{E}}(\mathbf{w},b)=-\sum_{\mathbf{x}_m\in\mathcal{E}}y_m(\mathbf{w}^{\mathsf T}\mathbf{x}_m+b)
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · Eq. (2) · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-031
  • Signed scores in E are negative, so LE(w,b)≥0\mathcal{L}_{\mathcal{E}}(\mathbf{w},b)\ge0.
  • Since LE(w,b)=0⟺E=∅\mathcal{L}_{\mathcal{E}}(\mathbf{w},b)=0\Longleftrightarrow\mathcal{E}=\varnothing, zero loss means every sample is correctly classified.

Gradient updates likewise use only samples in the error set.

Source equation · PDF p. 3

A hyperplane classifier separates classes by a weighted score's sign
w(i+1)=w(i)+α∑xm∈E(i)ymxm\mathbf{w}^{(i+1)}=\mathbf{w}^{(i)}+\alpha\sum_{\mathbf{x}_m\in\mathcal{E}^{(i)}}y_m\mathbf{x}_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
α\alphaLearning rate, mixture coefficient, or dual coefficient
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-034

Source equation · PDF p. 3

A hyperplane classifier separates classes by a weighted score's sign
b(i+1)=b(i)+α∑xm∈E(i)ymb^{(i+1)}=b^{(i)}+\alpha\sum_{\mathbf{x}_m\in\mathcal{E}^{(i)}}y_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
α\alphaLearning rate, mixture coefficient, or dual coefficient
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-035

Source notation requires review · PDF p. 3

A hyperplane classifier separates classes by a weighted score's sign
E(i)={xm:ym((w(i))Txm+b(i))<0}\mathcal{E}^{(i)}=\{\mathbf{x}_m:y_m((\mathbf{w}^{(i)})^{\mathsf T}\mathbf{x}_m+b^{(i)})<0\}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which side of the decision boundary contains input x?

Key idea

Calculate wᵀx+b: positive assigns one class, negative the other, and zero lies on the boundary.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Multiply corresponding features and weights

    wixiw_ix_i
  2. 2

    Sum the products and add bias

    g(x)=wTx+bg(x)=w^Tx+b
  3. 3

    Check the sign

    g(x)>0⇒+1,g(x)<0⇒−1g(x)>0\Rightarrow+1,\quad g(x)<0\Rightarrow-1
  4. 4

    Calculate boundary distance if needed

    distance=∣g(x)∣/∥w∥2\mathrm{distance}=|g(x)|/\lVert w\rVert_2

Worked example

Work through the numbers — Classifying one point

w=[1,-2], x=[3,1], and b=0.5.

  1. 1

    Weighted sum

    1⋅3+(−2)⋅1+0.5=1.51\cdot3+(-2)\cdot1+0.5=1.5
  2. 2

    Class

    sign⁡(1.5)=+1\operatorname{sign}(1.5)=+1
  3. 3

    Distance to the boundary

    1.5/12+(−2)2≈0.671.5/\sqrt{1^2+(-2)^2}\approx0.67

Result: The point is on the positive-class side, approximately 0.67 from the boundary.

Sanity check

Checks
  • w and x must have the same dimension.
  • Geometric distance requires |g(x)|, while signed distance may retain its sign.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · 3.1.2 Perceptron learning with gradient descent Identifier: MAI-P3-036

Lecture annotation — PDF p. 3
Handwritten -Σ yₘxₘ and -Σ yₘ appear beside the two ?? placeholders. A lower note connects loss and objective functions as descriptions of the same optimization goal. Some Korean handwriting is blurred and remains uncertain to read.

35×5 convolution2×2 subsamplingfeature maps0 … 9feature extractionclassification
Figure 1, reconstructed. Preserve the progression from input digits through two convolution/subsampling stages to a fully connected 0–9 classifier.

An alternative learns by minimizing MSE between desired and actual linear responses.

Source equation · PDF p. 4 · Eq. (3)

MSE has three steps: residuals, squares, and averaging
LMSE(w~)=12∑m=1M(ym−w~Tx~m)2\mathcal{L}_{\mathrm{MSE}}(\widetilde{\mathbf{w}})=\frac{1}{2}\sum_{m=1}^{M}\left(y_m-\widetilde{\mathbf{w}}^{\mathsf T}\widetilde{\mathbf{x}}_m\right)^2
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How far are predictions from targets on average?

Key idea

Subtract targets from predictions, square each residual, and divide by sample count. Larger errors receive greater penalties.

Formula-specific lesson

Alternative MSE learning: residuals, gradients, and step sizes

Sum augmented-vector MSE from a residual table and verify completed gradients and the data-dependent learning-rate bound from Hessian λmax.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Calculate predictions

    For linear regression, predictions are Xw or wᵀx.

    y^=Xw\hat y=Xw
  2. 2

    Calculate residuals

    r=y^−yr=\hat y-y
  3. 3

    Square the residuals

    Remove signs and emphasize larger errors.

    ri2r_i^2
  4. 4

    Sum and divide by sample count

    MSE=1L∑i=1Lri2\mathrm{MSE}=\frac{1}{L}\sum_{i=1}^{L}r_i^2

Worked example

Work through the numbers — MSE for two samples

Compare predictions and targets directly.

  1. 1

    Targets and predictions

    y=[3,1],y^=[2,4]y=[3,1],\quad\hat y=[2,4]
  2. 2

    Residual

    y^−y=[−1,3]\hat y-y=[-1,3]
  3. 3

    Square

    [−1,3]2=[1,9][-1,3]^2=[1,9]
  4. 4

    Average

    (1+9)/2=5(1+9)/2=5

Result: MSE is 5. The second sample's error of 3 substantially increases it.

Sanity check

Checks
  • Check whether the expression divides by sample count or is merely a sum of squares.
  • MSE has squared output units.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 4 · Eq. (3) · 3.1.2 Alternative learning model Identifier: MAI-P3-038

Here, ym∈{+1,−1}y_m\in\{+1,-1\}, the augmented parameters are w~≜[wT,b]T\widetilde{\mathbf{w}}\triangleq[\mathbf{w}^{\mathsf T},b]^{\mathsf T}, and the augmented input is x~m≜[xmT,1]T\widetilde{\mathbf{x}}_m\triangleq[\mathbf{x}_m^{\mathsf T},1]^{\mathsf T}. The source states LMSE(w~)>0\mathcal{L}_{\mathrm{MSE}}(\widetilde{\mathbf{w}})>0.

The source leaves this MSE’s gradient as ??.

Source notation requires review · PDF p. 4

A gradient describes the direction and rate of loss change
∂LMSE(w~)∂w~=??\frac{\partial\mathcal{L}_{\mathrm{MSE}}(\widetilde{\mathbf{w}})}{\partial\widetilde{\mathbf{w}}}=\text{??}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How much does the objective increase or decrease when each parameter increases?

Key idea

Collect partial derivatives into a vector and move in the opposite direction during minimization.

Formula-specific lesson

Alternative MSE learning: residuals, gradients, and step sizes

Sum augmented-vector MSE from a residual table and verify completed gradients and the data-dependent learning-rate bound from Hessian λmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Choose the differentiation variable

    Treat other variables as constants.

  2. 2

    Apply sum, product, and chain rules

    For composition, multiply the outer derivative by the inner derivative.

  3. 3

    Collect partial derivatives into one vector

    ∇f=[∂f/∂x1,…,∂f/∂xN]T\nabla f=[\partial f/\partial x_1,\ldots,\partial f/\partial x_N]^T
  4. 4

    Substitute current values

    Obtain numerical gradient magnitudes and signs.

Worked example

Work through the numbers — Gradient of a one-dimensional loss

The loss squares distance from target value 3.

  1. 1

    Function

    f(w)=(w−3)2f(w)=(w-3)^2
  2. 2

    Derivative

    f′(w)=2(w−3)f'(w)=2(w-3)
  3. 3

    Substitute w=5

    f′(5)=2(5−3)=4f'(5)=2(5-3)=4

Result: The positive gradient 4 means decreasing w reduces loss.

Sanity check

Checks
  • The gradient and parameter vectors must have matching lengths.
  • A constant term has derivative zero.

Symbols

Symbols used in this equation
SymbolMeaning
w\mathbf{w}Learned weight vector
∂\partialPartial derivative with respect to a particular variable
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 4 · 3.1.2 Alternative learning model Identifier: MAI-P3-043

Its LMS-style update accumulates residuals multiplied by inputs.

Source equation · PDF p. 4

Gradient descent steps opposite the gradient from the current point
w~(i+1)=w~(i)+α∑m=1M(ym−(w~(i))Tx~m)x~m\widetilde{\mathbf{w}}^{(i+1)}=\widetilde{\mathbf{w}}^{(i)}+\alpha\sum_{m=1}^{M}\left(y_m-(\widetilde{\mathbf{w}}^{(i)})^{\mathsf T}\widetilde{\mathbf{x}}_m\right)\widetilde{\mathbf{x}}_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Where should parameters move next to reduce loss?

Key idea

Calculate the gradient at current parameters, multiply by the learning rate, and subtract to obtain new parameters.

Formula-specific lesson

Alternative MSE learning: residuals, gradients, and step sizes

Sum augmented-vector MSE from a residual table and verify completed gradients and the data-dependent learning-rate bound from Hessian λmax.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Calculate the current loss gradient

    gk=∇J(wk)g_k=\nabla J(w_k)
  2. 2

    Determine the step size

    Δw=αgk\Delta w=\alpha g_k
  3. 3

    Move opposite the direction of increase

    wk+1=wk−αgkw_{k+1}=w_k-\alpha g_k
  4. 4

    Check the new loss and repeat

    Too large a learning rate can diverge; too small is very slow.

Worked example

Work through the numbers — One update

f(w)=(w-3)², current w=5, and learning rate α=0.1.

  1. 1

    Gradient

    g=2(5−3)=4g=2(5-3)=4
  2. 2

    Step size

    αg=0.1⋅4=0.4\alpha g=0.1\cdot4=0.4
  3. 3

    Update

    wnew=5−0.4=4.6w_{new}=5-0.4=4.6
  4. 4

    Compare losses

    f(5)=4,f(4.6)=2.56f(5)=4,\qquad f(4.6)=2.56

Result: One step reduces loss from 4 to 2.56.

Sanity check

Checks
  • Check for the minus sign.
  • Recording loss before and after updates alongside gradient norm helps detect divergence early.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
α\alphaLearning rate, mixture coefficient, or dual coefficient
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 4 · 3.1.2 Alternative learning model Identifier: MAI-P3-044

The lecture states 0<α<20<\alpha<2 is necessary but insufficient for convergence and gives typical range 0.1<α<10.1<\alpha<1. The exact data-dependent upper bound is checked separately in the editorial layer.

#3.2 Nonlinear discriminants: FCNs and MLPs

#3.2.1 Limits of a single perceptron

XOR cannot be solved by one linear boundary. The source places false-class points at S1={(0,0),(1,1)}S_1=\{(0,0),(1,1)\} and true-class points at S2={(1,0),(0,1)}S_2=\{(1,0),(0,1)\}.

Geometry shows no single separating line. The source proposes two linear boundaries or a nonlinear boundary such as a quadratic.

Lecture annotation — PDF p. 4
A sketch stacks w with b, and x with constant 1, into augmented vectors. Beside the MSE blank is derive the gradient directly; beside the learning rate are lower bound / upper bound. Remaining small writing is uncertain to read.

The source asks readers to sketch the geometry of both proposed solutions and leaves the answer blank.

Source notation requires review · PDF p. 5

Identify the equation's role and symbols
??\text{??}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

XOR: one line's limits and two hidden thresholds

Project the four XOR points onto s=x1+x2 to examine the need for two parallel boundaries, keeping source blanks separate from editorial completions.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · 3.2.1 XOR exercise Identifier: MAI-P3-049

It then asks whether multiple perceptrons can solve XOR and, if so, the minimum number of units.

Source notation requires review · PDF p. 5

Identify the equation's role and symbols
??\text{??}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

XOR: one line's limits and two hidden thresholds

Project the four XOR points onto s=x1+x2 to examine the need for two parallel boundaries, keeping source blanks separate from editorial completions.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · 3.2.1 XOR exercise Identifier: MAI-P3-050

#3.2.2 MLP overview

Figure 2 depicts a general multilayer network. The lecture defines:

  • A column of nodes forms a layer.
  • Every node is an artificial neuron.
  • A network is fully connected when each node’s output connects to every node in the next layer.
  • A network without loops is feedforward.
  • Neuron k’s output or activation in layer l is ak(l)a_k(l).

The goal is classifying unknown input-image patterns. A network with N_L outputs selects the class with greatest output activation.

Source equation · PDF p. 5

Identify the equation's role and symbols
ac(L)>ac′(L),c=1,…,NL, c′≠ca_c(L)>a_{c^{\prime}}(L),\quad c=1,\ldots,N_L,\ c^{\prime}\ne c
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · 3.2.2 Overview Identifier: MAI-P3-052

#3.2.3 Forward pass

A forward pass maps input x to output-layer values used for classification. Equation (4) gives neuron i’s scalar net input and activation.

Source notation requires review · PDF p. 5 · Eq. (4)

Identify the equation's role and symbols
ai(l)=h(zi(l)),zi(l)=∑j=1NL−1wi,j(l)aj(l−1)+bi(l),i=1,…,NL, l=2,…,La_i(l)=h(z_i(l)),\qquad z_i(l)=\sum_{j=1}^{N_{L-1}}w_{i,j}(l)a_j(l-1)+b_i(l),\quad i=1,\ldots,N_L,\ l=2,\ldots,L
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · Eq. (4) · 3.2.3 Forward pass Identifier: MAI-P3-053

Output nodes are ai(L)=h(zi(L)),i=1,…,NLa_i(L)=h(z_i(L)),\quad i=1,\ldots,N_L and the input layer is initialized with aj(1)=xj,j=1,…,N1,N1=Na_j(1)=x_j,\quad j=1,\ldots,N_1,\qquad N_1=N.

A footnote allows softmax instead of sigmoid in the final layer. Its activations sum to one and permit probabilistic interpretation.

Source equation · PDF p. 5

Identify the equation's role and symbols
ai(L)=exp⁡(zi(L))∑i′=1NLexp⁡(zi′(L))a_i(L)=\frac{\exp(z_i(L))}{\sum_{i^{\prime}=1}^{N_L}\exp(z_{i^{\prime}}(L))}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms
p(⋅)p(\cdot)Probability density or conditional probability density
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · 3.2.3 Forward pass footnote Identifier: MAI-P3-056

Lecture annotation — PDF p. 5
Near XOR and forward-pass equations are MLP and arrows indicating activations. Most short symbols and English notes remain uncertain to read because of resolution and overlapping handwriting.

Layer 1 · inputhidden layersLayer L · outputx₁x₂xₙa₁aₙzᵢ(l) = weighted sum + biasaᵢ(l) = h(zᵢ(l))
Figure 2, reconstructed. A new SVG shows inputs, hidden and output layers, fully connected interlayer edges, and weighted-sum→activation processing inside a neuron.

Collecting equation (4) into vector/matrix operations gives the activation/net-input relationship in equation (5).

Source notation requires review · PDF p. 6 · Eq. (5)

Matrix multiplication repeats row–column inner products
a(l)=h(z(l))=[h(z1(l))h(z2(l))⋮h(zNL(l))],z(l)=W(l)a(l−1)+b(l),l=2,…,L\mathbf{a}(l)=h(\mathbf{z}(l))=\begin{bmatrix}h(z_1(l))\\h(z_2(l))\\\vdots\\h(z_{N_L}(l))\end{bmatrix},\qquad \mathbf{z}(l)=\mathbf{W}(l)\mathbf{a}(l-1)+\mathbf{b}(l),\quad l=2,\ldots,L
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 6 · Eq. (5) · 3.2.3 Matrix formulation Identifier: MAI-P3-057

(a) DropOut

activation mask m

(b) DropConnect

weight mask M ⊙ W
Figure 3, reconstructed. Dropout masks activations; DropConnect masks weight connections. Dashed lines and X marks preserve that source distinction.

Source equation · PDF p. 7

Identify the equation's role and symbols
r=m⊙a(Wv)\mathbf{r}=\mathbf{m}\odot a(\mathbf{W}\mathbf{v})
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Dropout versus DropConnect: what is masked?

Use the same W and v to compare forward values when dropout masks activations and DropConnect masks weights.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
mc\mathbf{m}_cClass mean or representative point

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · Figure 3 DropOut Identifier: MAI-P3-058

Source equation · PDF p. 7

Identify the equation's role and symbols
r=a((M⊙W)v)\mathbf{r}=a((\mathbf{M}\odot\mathbf{W})\mathbf{v})
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Dropout versus DropConnect: what is masked?

Use the same W and v to compare forward values when dropout masks activations and DropConnect masks weights.

Interactive
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · Figure 3 DropConnect Identifier: MAI-P3-059

Equation (6) defines layer l’s weight matrix, but every source entry remains ??.

Source notation requires review · PDF p. 7 · Eq. (6)

Matrix multiplication repeats row–column inner products
W(l)≜[????⋯??????⋯??⋮⋮⋱⋮????⋯??]\mathbf{W}(l)\triangleq\begin{bmatrix}\text{??}&\text{??}&\cdots&\text{??}\\\text{??}&\text{??}&\cdots&\text{??}\\\vdots&\vdots&\ddots&\vdots\\\text{??}&\text{??}&\cdots&\text{??}\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · Eq. (6) · 3.2.3 Weight matrix Identifier: MAI-P3-060

Previous activations are a(l−1)∈RNl−1×1\mathbf{a}(l-1)\in\mathbb{R}^{N_{l-1}\times1}, bias b(l)∈RNl×1\mathbf{b}(l)\in\mathbb{R}^{N_l\times1}, and net input z(l)∈RNl×1\mathbf{z}(l)\in\mathbb{R}^{N_l\times1}. The source writes node indices as zi(l),i=1,…,NLz_i(l),\quad i=1,\ldots,N_L and inputs as a(1)=x\mathbf{a}(1)=\mathbf{x}.

To classify N_p patterns together, collect their vectors as columns.

Source equation · PDF p. 7

Identify the equation's role and symbols
X=[x1 ⋯ xNp]∈RN×Np\mathbf{X}=[\mathbf{x}_1\ \cdots\ \mathbf{x}_{N_p}]\in\mathbb{R}^{N\times N_p}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
X\mathbf{X}Data matrix collecting samples

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · 3.2.3 Batch forward pass Identifier: MAI-P3-066

Initial activation is A(1)=X\mathbf{A}(1)=\mathbf{X}; the minibatch forward pass follows.

Source notation requires review · PDF p. 7

Identify the equation's role and symbols
A(l)=h(Z(l))∈RNL×Np,Z(l)=W(l)A(l−1)+B(l)\mathbf{A}(l)=h(\mathbf{Z}(l))\in\mathbb{R}^{N_L\times N_p},\qquad \mathbf{Z}(l)=\mathbf{W}(l)\mathbf{A}(l-1)+\mathbf{B}(l)
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
A\mathbf{A}Linear transformation or coefficient matrix
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · 3.2.3 Batch forward pass Identifier: MAI-P3-068

The source gives previous-activation shape A(l−1)∈RNl−1×Np\mathbf{A}(l-1)\in\mathbb{R}^{N_{l-1}\times N_p} and duplicated-bias matrix B(l)∈RNL×Np\mathbf{B}(l)\in\mathbb{R}^{N_L\times N_p}. Each output column contains one pattern’s output activations.

#Dropout and DropConnect

  • Dropout drops activations.
  • DropConnect drops weights, introduced as a generalization of dropout.

They mask different locations, as shown in source Figure 3 and its reconstruction.

#3.3 Convolutional neural networks

#3.3.1 Convolution as a core DNN operator

Continuous convolution reflects one function about the vertical axis, shifts it, and integrates the product of both functions.

Source equation · PDF p. 7

Convolution slides a kernel and repeats elementwise products and sums
(f∗g)(t)≜∫−∞∞f(τ)g(t−τ) dτ(f\ast g)(t)\triangleq\int_{-\infty}^{\infty}f(\tau)g(t-\tau)\,d\tau
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Convolution definitions: continuous, discrete, and 2D

Connect a continuous Gaussian example, equivalent discrete sums, delta/LSI interpretations, and full 2D convolution in one view.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · 3.3.1 Continuous convolution Identifier: MAI-P3-071

Lecture annotation — PDF p. 7
Handwritten additions mask part of the activation vector for dropout and multiply a mask into the weight matrix for DropConnect. The phrases more samples, reduce complexity, and only training are legible. The convolution introduction includes a kernel-flipping sketch.

Engineering often uses notation f(t)*g(t). Discrete convolution has these equivalent definitions.

Source equation · PDF p. 8

Convolution slides a kernel and repeats elementwise products and sums
(f∗g)[n]≜∑m=−∞∞f[m]g[n−m](f\ast g)[n]\triangleq\sum_{m=-\infty}^{\infty}f[m]g[n-m]
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Convolution definitions: continuous, discrete, and 2D

Connect a continuous Gaussian example, equivalent discrete sums, delta/LSI interpretations, and full 2D convolution in one view.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 8 · 3.3.1 Discrete convolution Identifier: MAI-P3-072

Source equation · PDF p. 8

Convolution slides a kernel and repeats elementwise products and sums
(f∗g)[n]≜∑m=−∞∞f[n−m]g[m](f\ast g)[n]\triangleq\sum_{m=-\infty}^{\infty}f[n-m]g[m]
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Convolution definitions: continuous, discrete, and 2D

Connect a continuous Gaussian example, equivalent discrete sums, delta/LSI interpretations, and full 2D convolution in one view.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 8 · 3.3.1 Discrete convolution Identifier: MAI-P3-073

#3.3.2 Two-dimensional convolution

The Kronecker impulse’s sifting property expresses any 2D discrete signal as a sum of shifted impulses.

Source equation · PDF p. 8

Convolution slides a kernel and repeats elementwise products and sums
f[m,n]=∑k=−∞∞∑l=−∞∞f[k,l]δ[m−k,n−l]f[m,n]=\sum_{k=-\infty}^{\infty}\sum_{l=-\infty}^{\infty}f[k,l]\delta[m-k,n-l]
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Convolution definitions: continuous, discrete, and 2D

Connect a continuous Gaussian example, equivalent discrete sums, delta/LSI interpretations, and full 2D convolution in one view.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 8 · 3.3.2 2D convolution Identifier: MAI-P3-074

For linear shift-invariant systems, superposition sums responses to each shifted impulse.

Source equation · PDF p. 8

Convolution slides a kernel and repeats elementwise products and sums
f[m,n]=∑k,lf[k,l]δ[m−k,n−l]→LSI∑k,lf[k,l]h[m−k,n−l]f[m,n]=\sum_{k,l}f[k,l]\delta[m-k,n-l]\xrightarrow{\mathrm{LSI}}\sum_{k,l}f[k,l]h[m-k,n-l]
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Convolution definitions: continuous, discrete, and 2D

Connect a continuous Gaussian example, equivalent discrete sums, delta/LSI interpretations, and full 2D convolution in one view.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 8 · 3.3.2 2D convolution Identifier: MAI-P3-075

Thus, a general 2D discrete-space LSI system’s input–output relationship is a 2D convolution sum.

Source equation · PDF p. 8

Convolution slides a kernel and repeats elementwise products and sums
g[m,n]=∑k=−∞∞∑l=−∞∞f[k,l]h[m−k,n−l]=f[m,n]∗h[m,n]g[m,n]=\sum_{k=-\infty}^{\infty}\sum_{l=-\infty}^{\infty}f[k,l]h[m-k,n-l]=f[m,n]\ast h[m,n]
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Convolution definitions: continuous, discrete, and 2D

Connect a continuous Gaussian example, equivalent discrete sums, delta/LSI interpretations, and full 2D convolution in one view.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 8 · 3.3.2 2D convolution Identifier: MAI-P3-076

The source’s boxed note: An LSI system is fully specified by its impulse response.

#Computing 2D convolution

  1. Flip h[k,l] about the origin to obtain h[−k,−l]h[-k,-l].
  1. Shift it by m,n to obtain h[m−k,n−l]h[m-k,n-l].
  1. Multiply the shifted kernel and f[k,l] elementwise.
  1. Sum over every k,l.
  1. Repeat for every output location m,n.

Paper mathematics permits infinite images, but computers handle finite-support images implicitly zero outside a rectangle. MATLAB conv2 requires users to track the origin.

Full convolution of M₁×N₁ and M₂×N₂ images has size:

Source equation · PDF p. 8

Identify the equation's role and symbols
(M1+M2−1)×(N1+N2−1)(M_1+M_2-1)\times(N_1+N_2-1)
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 8 · 3.3.2 Image support Identifier: MAI-P3-079

The option conv2(..., "same") discards boundary pixels to match the first input’s size.

Lecture annotation — PDF p. 8
The top sketches a flipped, shifted 1D kernel; the right side shows input/kernel grids and summation of products. The meaning of flip and weighted sums is clear, but some Korean explanations remain uncertain to read.

The first example calculates full convolution g from given h and f.

Source equation · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
h[k,l]=[246123]h[k,l]=\begin{bmatrix}2&4&6\\1&2&3\end{bmatrix}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 2D convolution exercise Identifier: MAI-P3-080

Source notation requires review · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
h[−k,−l]=?h[-k,-l]=\text{?}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 2D convolution exercise Identifier: MAI-P3-081

Source equation · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
f[k,l]=[00001000000111000000]f[k,l]=\begin{bmatrix}0&0&0&0&1\\0&0&0&0&0\\0&1&1&1&0\\0&0&0&0&0\end{bmatrix}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 2D convolution exercise Identifier: MAI-P3-082

Source notation requires review · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
g[m,n]=[0000246????????????????3????0000000]g[m,n]=\begin{bmatrix}0&0&0&0&2&4&6\\?&?&?&?&?&?&?\\?&?&?&?&?&?&?\\?&?&3&?&?&?&?\\0&0&0&0&0&0&0\end{bmatrix}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 2D convolution exercise Identifier: MAI-P3-083

The second applies a 3×3 moving-average system to an infinite checkerboard.

Source equation · PDF p. 9

Matrix multiplication repeats row–column inner products
19[111111111]\frac{1}{9}\begin{bmatrix}1&1&1\\1&1&1\\1&1&1\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 Moving-average exercise Identifier: MAI-P3-084

Source equation · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
f[m,n]=cos⁡(πm)cos⁡(πn)=(−1)m+nf[m,n]=\cos(\pi m)\cos(\pi n)=(-1)^{m+n}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 Moving-average exercise Identifier: MAI-P3-085

The input alternates +1 and −1.

Source equation · PDF p. 9

Matrix multiplication repeats row–column inner products
[1−11−11−11−11] ⋯\begin{bmatrix}1&-1&1\\-1&1&-1\\1&-1&1\end{bmatrix}\ \cdots
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 Moving-average exercise Identifier: MAI-P3-086

Source notation requires review · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
g[m,n]=?g[m,n]=\text{?}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 Moving-average exercise Identifier: MAI-P3-087

#Computation and separability

The source approximates operation count for convolving N₁×M₁ and N₂×M₂ images as follows.

Source equation · PDF p. 9

Identify the equation's role and symbols
(N1+N2−1)(M1+M2−1)min⁡{N1M1,N2M2}(N_1+N_2-1)(M_1+M_2-1)\min\{N_1M_1,N_2M_2\}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Interactive
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 Computation and separability Identifier: MAI-P3-088

For N₁=M₁=N much larger than kernel size M, this is roughly N2M2N^2M^2.

A separable kernel h[m,n]=h1[m]h2[n]h[m,n]=h_1[m]h_2[n] permits rearranging the double sum into two 1D convolutions.

Source equation · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
∑k=−∞∞∑l=−∞∞f[k,l]h1[m−k]h2[n−l]=∑k=−∞∞h1[m−k](∑l=−∞∞f[k,l]h2[n−l])\sum_{k=-\infty}^{\infty}\sum_{l=-\infty}^{\infty}f[k,l]h_1[m-k]h_2[n-l]=\sum_{k=-\infty}^{\infty}h_1[m-k]\left(\sum_{l=-\infty}^{\infty}f[k,l]h_2[n-l]\right)
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · 3.3.2 Computation and separability Identifier: MAI-P3-091
  • The inner sum ∑l=−∞∞f[k,l]h2[n−l]\sum_{l=-\infty}^{\infty}f[k,l]h_2[n-l] applies h₂ along each column.
  • The outer sum ∑k=−∞∞h1[m−k](⋅)\sum_{k=-\infty}^{\infty}h_1[m-k](\cdot) applies h₁ along each intermediate row.

For a large N×N image and small separable M×M kernel, cost is roughly 2N2M2N^2M. The source states an approximately M2\frac{M}{2}-fold computational gain.

Since M is usually at least three, the source asks for the minimum reduction as ?%\text{?}\% and leaves it blank.

#3.3.3 A global matrix representation of convolution

Begin with 1D convolution for simplicity.

Source equation · PDF p. 9 · Eq. (7)

Convolution slides a kernel and repeats elementwise products and sums
g[n]=h[n]∗f[n]=∑kh[n−k]f[k],n=0,…,N−1g[n]=h[n]\ast f[n]=\sum_k h[n-k]f[k],\quad n=0,\ldots,N-1
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · Eq. (7) · 3.3.3 Global matrix formulation Identifier: MAI-P3-097

The aim is to express a DSP relationship as matrix–vector multiplication.

Source equation · PDF p. 9 · Eq. (8)

Identify the equation's role and symbols
y=Ax\mathbf{y}=\mathbf{A}\mathbf{x}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
y\mathbf{y}Target or observation vector
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · Eq. (8) · 3.3.3 Global matrix formulation Identifier: MAI-P3-098

For N≥M, a footnote says carefully implemented convolution of N- and M-point signals requires MN multiplicationsMN\ \text{multiplications} and nearly as many additions.

Lecture annotation — PDF p. 9
Above the first example is a handwritten 180°-rotated kernel [[3,2,1],[6,4,2]], with calculated entries in part of the output grid. Factorization / outer product appears beside separability, and lower notes connect periodic convolution with Fourier transforms. Some overlapping frequency-domain expressions remain uncertain to read.

Zero

4 2 0 0 0 0
1 4 2 0 0 0
0 1 4 2 0 0
0 0 1 4 2 0
0 0 0 1 4 2
0 0 0 0 1 4

Extended

1 4 2 0 0 0 0 0
0 1 4 2 0 0 0 0
0 0 1 4 2 0 0 0
0 0 0 1 4 2 0 0
0 0 0 0 1 4 2 0
0 0 0 0 0 1 4 2

Periodic

4 2 0 0 0 1
1 4 2 0 0 0
0 1 4 2 0 0
0 0 1 4 2 0
0 0 0 1 4 2
2 0 0 0 1 4
Figure 4, reconstructed. For h[n]=1 and N=6, preserve every number showing how zero, extended, and periodic boundaries change the system matrix.

Source equation · PDF p. 10

Identify the equation's role and symbols
h[n]={2,4,1}=2δ[n+1]+4δ[n]+δ[n−1],N=6h[n]=\{2,4,1\}=2\delta[n+1]+4\delta[n]+\delta[n-1],\quad N=6
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · Figure 4 Boundary conditions Identifier: MAI-P3-100

Source equation · PDF p. 10

Matrix multiplication repeats row–column inner products
Azero=[420000142000014200001420000142000014]\mathbf{A}_{\mathrm{zero}}=\begin{bmatrix}4&2&0&0&0&0\\1&4&2&0&0&0\\0&1&4&2&0&0\\0&0&1&4&2&0\\0&0&0&1&4&2\\0&0&0&0&1&4\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · Figure 4 Boundary conditions Identifier: MAI-P3-101

Source equation · PDF p. 10

Matrix multiplication repeats row–column inner products
Aextended=[142000000142000000142000000142000000142000000142]\mathbf{A}_{\mathrm{extended}}=\begin{bmatrix}1&4&2&0&0&0&0&0\\0&1&4&2&0&0&0&0\\0&0&1&4&2&0&0&0\\0&0&0&1&4&2&0&0\\0&0&0&0&1&4&2&0\\0&0&0&0&0&1&4&2\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · Figure 4 Boundary conditions Identifier: MAI-P3-102

Source equation · PDF p. 10

Matrix multiplication repeats row–column inner products
Aperiodic=[420001142000014200001420000142200014]\mathbf{A}_{\mathrm{periodic}}=\begin{bmatrix}4&2&0&0&0&1\\1&4&2&0&0&0\\0&1&4&2&0&0\\0&0&1&4&2&0\\0&0&0&1&4&2\\2&0&0&0&1&4\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · Figure 4 Boundary conditions Identifier: MAI-P3-103

Vectors y and x have finite column length, and h[n] determines A. Although mathematical convolution allows arbitrary indices, finite storage requires choosing A and x according to boundary conditions.

In every case, vectorize measurements g[n] as follows.

Source equation · PDF p. 10 · Eq. (9)

Matrix multiplication repeats row–column inner products
y=[y1⋮yN]=[g[0]⋮g[N−1]]\mathbf{y}=\begin{bmatrix}y_1\\\vdots\\y_N\end{bmatrix}=\begin{bmatrix}g[0]\\\vdots\\g[N-1]\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
y\mathbf{y}Target or observation vector

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · Eq. (9) · 3.3.3 Global matrix formulation Identifier: MAI-P3-104

Matrix indices start at one and signal indices at zero, giving yi=g[i−1]y_i=g[i-1]. Define noise vectors similarly.

The example’s three-point impulse response is:

Source equation · PDF p. 10

Identify the equation's role and symbols
h[n]=h[−1]δ[n+1]+h[0]δ[n]+h[1]δ[n−1]h[n]=h[-1]\delta[n+1]+h[0]\delta[n]+h[1]\delta[n-1]
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · 3.3.3 Impulse response Identifier: MAI-P3-106

The Kronecker impulse is this piecewise function.

Source equation · PDF p. 10

Identify the equation's role and symbols
δ[n]={1,n=0,0,otherwise.\delta[n]=\begin{cases}1,&n=0,\\0,&\text{otherwise}.\end{cases}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · 3.3.3 Impulse response Identifier: MAI-P3-107

#Zero boundary conditions

The simplest model assumes f[n]=0(n<0 or n≥N)f[n]=0\quad(n<0\ \text{or}\ n\ge N) and restricts convolution to ∑k=0N−1\sum_{k=0}^{N-1}. This is also called a Dirichlet boundary condition.

Source equation · PDF p. 10 · Eq. (10)

Matrix multiplication repeats row–column inner products
A=[h[0]h[−1]0⋯000h[1]h[0]h[−1]0⋯000h[1]h[0]h[−1]0⋯0⋮⋮⋮⋱⋮⋮⋮0⋯0h[1]h[0]h[−1]000⋯0h[1]h[0]h[−1]000⋯0h[1]h[0]],x=[f[0]⋮f[N−1]]\mathbf{A}=\begin{bmatrix}h[0]&h[-1]&0&\cdots&0&0&0\\h[1]&h[0]&h[-1]&0&\cdots&0&0\\0&h[1]&h[0]&h[-1]&0&\cdots&0\\\vdots&\vdots&\vdots&\ddots&\vdots&\vdots&\vdots\\0&\cdots&0&h[1]&h[0]&h[-1]&0\\0&0&\cdots&0&h[1]&h[0]&h[-1]\\0&0&0&\cdots&0&h[1]&h[0]\end{bmatrix},\qquad \mathbf{x}=\begin{bmatrix}f[0]\\\vdots\\f[N-1]\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 10 · Eq. (10) · 3.3.3 Zero boundary conditions Identifier: MAI-P3-110

Lecture annotation — PDF p. 10
Handwriting above the matrices contrasts zero, extended, and periodic boundaries and marks circular boundaries. Some numbers match the source matrix, but most overlapping prose remains uncertain to read.

Equation (10)‘s N×N A is Toeplitz, constant along each diagonal. The source cites references [1,2] for relatively fast algorithms handling these matrices.

Source equation · PDF p. 11

Identify the equation's role and symbols
Ai,j=h[i−j],i,j=1,…,NA_{i,j}=h[i-j],\quad i,j=1,\ldots,N
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · 3.3.3 Toeplitz structure Identifier: MAI-P3-111

For shift-invariant problems, pass h and f to a convolution routine rather than storing A explicitly. Matrix notation remains useful for analysis.

For shift-variant problems, A may be stored explicitly, with sparse representations efficient when h has few nonzero entries.

#Extended boundary conditions

In optical imaging, PSF spreading lets scenes outside the measured field of view affect observations. Zero boundaries can be unrealistic; regularization or constraints may recover parts of an object vector longer than the measurement vector.

Source equation · PDF p. 11 · Eq. (11)

Matrix multiplication repeats row–column inner products
A=[h[1]h[0]h[−1]0⋯000h[1]h[0]h[−1]0⋯0⋮⋮⋮⋱⋮⋮⋮00⋯0h[1]h[0]h[−1]],x=[f[−1]f[0]⋮f[N−1]f[N]]\mathbf{A}=\begin{bmatrix}h[1]&h[0]&h[-1]&0&\cdots&0&0\\0&h[1]&h[0]&h[-1]&0&\cdots&0\\\vdots&\vdots&\vdots&\ddots&\vdots&\vdots&\vdots\\0&0&\cdots&0&h[1]&h[0]&h[-1]\end{bmatrix},\qquad \mathbf{x}=\begin{bmatrix}f[-1]\\f[0]\\\vdots\\f[N-1]\\f[N]\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · Eq. (11) · 3.3.3 Extended boundary conditions Identifier: MAI-P3-112

A has shape A∈RN×(N+L−1)\mathbf{A}\in\mathbb{R}^{N\times(N+L-1)}, with L=3 here. The author considers extended boundaries the most realistic choice for many restoration problems when feasible.

MATLAB note: for row vector b=[h[−1],h[0],h[1]]\mathbf{b}=[h[-1],h[0],h[1]], convmtx(fliplr(b), N) constructs this A. It relates to the valid option of 2D conv2.

#Periodic boundary conditions

Another choice assumes f[n]=f[n mod N]f[n]=f[n\bmod N]. Though rarely exact for real images, it is useful in frequency-domain analysis.

Source equation · PDF p. 11

Convolution slides a kernel and repeats elementwise products and sums
gˉ[n]=h~[n]∗Nf[n]=∑k=0N−1h~[(n−k) mod N]f[k],n=0,…,N−1\bar g[n]=\widetilde h[n]\ast_N f[n]=\sum_{k=0}^{N-1}\widetilde h[(n-k)\bmod N]f[k],\quad n=0,\ldots,N-1
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · 3.3.3 Periodic boundary conditions Identifier: MAI-P3-116

The periodically overlapped and summed impulse response is equation (12).

Source equation · PDF p. 11 · Eq. (12)

Identify the equation's role and symbols
h~[n]≜∑lh[n−lN]\widetilde h[n]\triangleq\sum_l h[n-lN]
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · Eq. (12) · 3.3.3 Periodic boundary conditions Identifier: MAI-P3-117

The footnote defines modulo and floor as follows.

Source equation · PDF p. 11

Identify the equation's role and symbols
n mod N≜n−N⌊nN⌋n\bmod N\triangleq n-N\left\lfloor\frac{n}{N}\right\rfloor
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · 3.3.3 Modulo footnote Identifier: MAI-P3-118

Lecture annotation — PDF p. 11
Marks around Toeplitz, extended, and periodic boundaries connect Fourier analysis and circulant structure. Complete sentences cannot be reliably transcribed and remain uncertain to read.

Assuming the blur kernel vanishes for |n|≥N simplifies equation (12) as follows.

Source equation · PDF p. 11

Identify the equation's role and symbols
h~[n]=h[n]+h[n−N],n=0,…,N−1\widetilde h[n]=h[n]+h[n-N],\quad n=0,\ldots,N-1
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · 3.3.3 Periodic boundary conditions Identifier: MAI-P3-119

Circular convolution’s N×N system matrix is circulant, as in equation (13).

Source equation · PDF p. 11 · Eq. (13)

Matrix multiplication repeats row–column inner products
A=[h~[0]h~[N−1]h~[N−2]⋯h~[2]h~[1]h~[1]h~[0]h~[N−1]h~[N−2]⋯h~[2]⋮⋮⋱⋮⋮⋮h~[N−1]h~[N−2]h~[N−3]⋯h~[1]h~[0]]\mathbf{A}=\begin{bmatrix}\widetilde h[0]&\widetilde h[N-1]&\widetilde h[N-2]&\cdots&\widetilde h[2]&\widetilde h[1]\\\widetilde h[1]&\widetilde h[0]&\widetilde h[N-1]&\widetilde h[N-2]&\cdots&\widetilde h[2]\\\vdots&\vdots&\ddots&\vdots&\vdots&\vdots\\\widetilde h[N-1]&\widetilde h[N-2]&\widetilde h[N-3]&\cdots&\widetilde h[1]&\widetilde h[0]\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · Eq. (13) · 3.3.3 Circulant matrix Identifier: MAI-P3-120

Its entries satisfy Ai,j=h~[(i−j) mod N]A_{i,j}=\widetilde h[(i-j)\bmod N], described as an approximation of Toeplitz form.

#Mirror conditions

The source prints reflective boundaries as Nuemann boundary conditions. The usual term is Neumann boundary conditions: mirror the signal at both boundaries.

Source equation · PDF p. 11

Identify the equation's role and symbols
f[−n]=f[n],f[N−1+n]=f[N−1−n],n=0,…,N−1f[-n]=f[n],\qquad f[N-1+n]=f[N-1-n],\quad n=0,\ldots,N-1
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Global convolution matrices: zero, extended, periodic, and mirror boundaries

Use h[-1]=2, h[0]=4, h[1]=1, and N=6 to compare Toeplitz, extended, and circulant matrices and boundary outputs for the same x.

Interactive
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 11 · 3.3.3 Mirror conditions Identifier: MAI-P3-122

#2D matrix-vector representations

The principle extends to 2D and higher dimensions. A becomes more complicated, but both 1D and 2D retain matrix–vector form y=Ax\mathbf{y}=\mathbf{A}\mathbf{x}.

#3.3.4 Local or patch-based convolution representation

Input f includes padding and has size NN. Output g has the unpadded input’s pixel count, g∈RN0\mathbf{g}\in\mathbb{R}^{N_0}.

Define the P-location neighborhood of pixel s as window W(s).

Source equation · PDF p. 12

Identify the equation's role and symbols
W(s)=[s,s+r1,…,s+rP−1]W(s)=[s,s+r_1,\ldots,s+r_{P-1}]
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Interactive
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 12 · 3.3.4 Local patch perspective Identifier: MAI-P3-126

Here, r1,…,rP−1r_1,\ldots,r_{P-1} denotes an index neighbor.

The text defines z_s as a column of f’s window pixels, but its printed expression uses y. That source notation is preserved.

Source notation requires review · PDF p. 12

Identify the equation's role and symbols
zsT=[(yW(s))1,(yW(s))2,…,(yW(s))P]\mathbf{z}_s^{\mathsf T}=[(\mathbf{y}_{W(s)})_1,(\mathbf{y}_{W(s)})_2,\ldots,(\mathbf{y}_{W(s)})_P]
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
y\mathbf{y}Target or observation vector

Reference-quality follow-up

Explore this calculation further
PDF p. 12 · 3.3.4 Local patch perspective Identifier: MAI-P3-128

The column h collects filter parameters.

Source equation · PDF p. 12

Matrix multiplication repeats row–column inner products
h=[h1⋮hP]\mathbf{h}=\begin{bmatrix}h_1\\\vdots\\h_P\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 12 · 3.3.4 Local patch perspective Identifier: MAI-P3-129

Interior pixels are defined by S0⊂SS_0\subset S, N0<NN_0<N, and S0=[s1,…,sN0]S_0=[s_1,\ldots,s_{N_0}].

Stacking patches as rows gives design matrix Z.

Source equation · PDF p. 12

Matrix multiplication repeats row–column inner products
Z=[zs1T⋮zsN0T]∈RN0×P\mathbf{Z}=\begin{bmatrix}\mathbf{z}_{s_1}^{\mathsf T}\\\vdots\\\mathbf{z}_{s_{N_0}}^{\mathsf T}\end{bmatrix}\in\mathbb{R}^{N_0\times P}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 12 · 3.3.4 Local patch perspective Identifier: MAI-P3-133

Lecture annotation — PDF p. 12
The top sketches FCN weight shapes, the middle compares zero/circular system matrices, and the bottom shows patch extraction → dot product: flatten an image patch and dot it with a filter for one output. Some blue Korean notes remain uncertain to read.

The source’s stacked output vector contains an isolated x before its last entry.

Source notation requires review · PDF p. 13

Matrix multiplication repeats row–column inner products
g=[gs1gs2⋮xgN0]\mathbf{g}=\begin{bmatrix}g_{s_1}\\g_{s_2}\\\vdots\\xg_{N_0}\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 13 · 3.3.4 Local patch perspective Identifier: MAI-P3-134

It then states g∈RN0\mathbf{g}\in\mathbb{R}^{N_0} and summarizes patch convolution in one line.

Source equation · PDF p. 13

Identify the equation's role and symbols
g=Zh\mathbf{g}=\mathbf{Z}\mathbf{h}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 13 · 3.3.4 Local patch perspective Identifier: MAI-P3-136

#3.4 Core DNN modules

DNNs chain or repeat operators. The lecture recommends assembling networks from these layers in PyTorch’s torch.nn documentation.

  • nn.Linear: fully connected networks or MLPs.
  • nn.Conv2d: CNNs; out_channels and kernel_size control feature count and filter size.
  • nn.ConvTranspose2d: upsampling through transposed convolution.
  • nn.ReLU: interlayer nonlinearity through h(z)=max⁡(0,z)h(z)=\max(0,z).
  • nn.MaxPool2d and nn.AvgPool2d: two pooling types.
  • nn.Upsample: interpolation-based activation-map enlargement, common in U-Net.
  • nn.Dropout: reducing overfitting.

#PyTorch convolution

The source includes API-signature screenshots for Conv1d, Conv2d, and Conv3d. Its example settings follow.

The screenshots each show [SOURCE] at right for documentation links. Visible signatures are transcribed below, but absent active URI annotations prevent reliable destination recovery.

  • torch.nn.Conv1d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)
  • torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)
  • torch.nn.Conv3d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)

Source equation · PDF p. 13

Identify the equation's role and symbols
Cin=64,Cout=64,K=3,p=1,s=1C_{\mathrm{in}}=64,\quad C_{\mathrm{out}}=64,\quad K=3,\quad p=1,\quad s=1
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
CCTotal class count or a matrix; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 13 · 3.4 Conv2d source setup Identifier: MAI-P3-138
Input feature volume64 input channelsone 3×3×64 filter64 filters → 64 outputsOutput feature volumepadding 1 · stride 1same filter, next spatial positionStep 1Step 2 · shift by one cell
PDF pp. 13–14, reconstructed. Each output channel dots 64 input channels against 64 3×3 slices; 64 filters produce 64 output channels. The Step 1–2 diagram also preserves movement by one spatial position with padding one and stride one.

Lecture annotation — PDF p. 13
Read by myself appears beside core modules. Arrows connect ConvTranspose2d with kernel flipping, and notes point to ReLU and layers; some remain uncertain to read.

Step 2 on PDF p. 14 continues the same 3×3 filter at the next spatial position, filling an output voxel.

#3.4.1 PyTorch max pooling

The source shows MaxPool1d, MaxPool2d, and MaxPool3d signatures, then calculates a 2D example in stages with these settings.

Each MaxPool screenshot also shows [SOURCE] at right. The visible signatures follow; only their displayed text is recorded because link URIs are absent.

  • torch.nn.MaxPool1d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)
  • torch.nn.MaxPool2d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)
  • torch.nn.MaxPool3d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)
K=3,s=2,p=1K=3,\quad s=2,\quad p=1

Padded input

0 0 0 0 0 0 0
0 1 3 2 3 3 0
0 3 1 2 1 1 0
0 3 3 3 1 2 0
0 2 2 1 2 1 0
0 2 3 2 1 2 0
0 0 0 0 0 0 0

3×3 window

stride 2

padding 1

→

Source-visible progress

Step 1: 3 · ·
      · · ·
      · · ·

Step 2: 3 3 ·
      · · ·
      · · ·
PDF pp. 14–15, reconstructed. The source pads a 5×5 input by one cell to 7×7, then uses a 3×3 window and stride two. It fills only the first two output cells and leaves the rest blank.

Source notation requires review · PDF p. 15

Matrix multiplication repeats row–column inner products
Ystep 1=[3□□□□□□□□],Ystep 2=[33□□□□□□□]\mathbf{Y}_{\mathrm{step\,1}}=\begin{bmatrix}3&\square&\square\\\square&\square&\square\\\square&\square&\square\end{bmatrix},\qquad \mathbf{Y}_{\mathrm{step\,2}}=\begin{bmatrix}3&3&\square\\\square&\square&\square\\\square&\square&\square\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 15 · 3.4.1 MaxPool step diagrams Identifier: MAI-P3-140

#References in the lecture material

  1. R. H.-F. Chan and X.-Q. Jin, An Introduction to Iterative Toeplitz Solvers. Society for Industrial and Applied Mathematics, 2007.
  1. W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, Numerical Recipes in C, 2nd ed., Cambridge, U.K., 1992.
  1. P. C. Hansen, J. G. Nagy, and D. P. O’Leary, Deblurring Images: Matrices, Spectra, and Filtering. SIAM, 2006, vol. 3.
  1. I. Y. Chun and J. A. Fessler, “Convolutional dictionary learning: Acceleration and convergence,” IEEE Transactions on Image Processing, 27(4), 1697–1712, 2018, DOI 10.1109/TIP.2017.2761545.
  1. I. Y. Chun and J. A. Fessler, “Convolutional analysis operator learning: Acceleration and convergence,” IEEE Transactions on Image Processing, 29, 2108–2122, 2020, DOI 10.1109/TIP.2019.2937734.

The PDF shows this link, Wiki, and PyTorch documentation references, but not every URI can be recovered reliably. Visible source labels are preserved without inventing destinations.

#Editorial and mathematical audit

#Completing the general line equation

Set x₁=x and x₂=y and move all terms to one side to complete ? on PDF p. 1.

Completed source placeholder · PDF p. 1

Identify the equation's role and symbols
−ax1+x2−c=0,(w1,w2,b)=(−a,1,−c)-a x_1+x_2-c=0,\qquad (w_1,w_2,b)=(-a,1,-c)
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 1 · Editorial completion: line mapping Identifier: MAI-P3-141

#Absolute value in origin-to-hyperplane distance

The source’s b/‖w‖₂ can be signed. Geometric distance requires its absolute value.

Mathematically corrected variant · PDF p. 2

MSE has three steps: residuals, squares, and averaging
dist⁡(0,{x:wTx+b=0})=∣b∣∥w∥2\operatorname{dist}(\mathbf{0},\{\mathbf{x}:\mathbf{w}^{\mathsf T}\mathbf{x}+b=0\})=\frac{|b|}{\lVert\mathbf{w}\rVert_2}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How far are predictions from targets on average?

Key idea

Subtract targets from predictions, square each residual, and divide by sample count. Larger errors receive greater penalties.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Calculate predictions

    For linear regression, predictions are Xw or wᵀx.

    y^=Xw\hat y=Xw
  2. 2

    Calculate residuals

    r=y^−yr=\hat y-y
  3. 3

    Square the residuals

    Remove signs and emphasize larger errors.

    ri2r_i^2
  4. 4

    Sum and divide by sample count

    MSE=1L∑i=1Lri2\mathrm{MSE}=\frac{1}{L}\sum_{i=1}^{L}r_i^2

Worked example

Work through the numbers — MSE for two samples

Compare predictions and targets directly.

  1. 1

    Targets and predictions

    y=[3,1],y^=[2,4]y=[3,1],\quad\hat y=[2,4]
  2. 2

    Residual

    y^−y=[−1,3]\hat y-y=[-1,3]
  3. 3

    Square

    [−1,3]2=[1,9][-1,3]^2=[1,9]
  4. 4

    Average

    (1+9)/2=5(1+9)/2=5

Result: MSE is 5. The second sample's error of 3 substantially increases it.

Sanity check

Checks
  • Check whether the expression divides by sample count or is merely a sum of squares.
  • MSE has squared output units.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∥⋅∥\lVert\cdot\rVertMagnitude of a vector or error

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · Editorial correction: origin distance Identifier: MAI-P3-142

#Absolute value in point-to-hyperplane distance

g(x)/‖w‖₂ is signed distance; geometric distance is |g(x)|/‖w‖₂.

Mathematically corrected variant · PDF p. 2

MSE has three steps: residuals, squares, and averaging
dist⁡(x,{u:wTu+b=0})=∣g(x)∣∥w∥2\operatorname{dist}(\mathbf{x},\{\mathbf{u}:\mathbf{w}^{\mathsf T}\mathbf{u}+b=0\})=\frac{|g(\mathbf{x})|}{\lVert\mathbf{w}\rVert_2}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How far are predictions from targets on average?

Key idea

Subtract targets from predictions, square each residual, and divide by sample count. Larger errors receive greater penalties.

Formula-specific lesson

Linear discriminants: hyperplanes, signs, and distances

For the same w, b, and x, calculate scores, sign classifications, signed/absolute distances, and separation margins, distinguishing source distance notation from corrections.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Calculate predictions

    For linear regression, predictions are Xw or wᵀx.

    y^=Xw\hat y=Xw
  2. 2

    Calculate residuals

    r=y^−yr=\hat y-y
  3. 3

    Square the residuals

    Remove signs and emphasize larger errors.

    ri2r_i^2
  4. 4

    Sum and divide by sample count

    MSE=1L∑i=1Lri2\mathrm{MSE}=\frac{1}{L}\sum_{i=1}^{L}r_i^2

Worked example

Work through the numbers — MSE for two samples

Compare predictions and targets directly.

  1. 1

    Targets and predictions

    y=[3,1],y^=[2,4]y=[3,1],\quad\hat y=[2,4]
  2. 2

    Residual

    y^−y=[−1,3]\hat y-y=[-1,3]
  3. 3

    Square

    [−1,3]2=[1,9][-1,3]^2=[1,9]
  4. 4

    Average

    (1+9)/2=5(1+9)/2=5

Result: MSE is 5. The second sample's error of 3 substantially increases it.

Sanity check

Checks
  • Check whether the expression divides by sample count or is merely a sum of squares.
  • MSE has squared output units.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∥⋅∥\lVert\cdot\rVertMagnitude of a vector or error

Reference-quality follow-up

Explore this calculation further
PDF p. 2 · Editorial correction: point distance Identifier: MAI-P3-143

#Completing the perceptron w gradient

Differentiating equation (1) with respect to w gives the negative sum of yₘxₘ.

Completed source placeholder · PDF p. 3

A gradient describes the direction and rate of loss change
∂L∂w=−∑m=1Mymxm\frac{\partial\mathcal{L}}{\partial\mathbf{w}}=-\sum_{m=1}^{M}y_m\mathbf{x}_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How much does the objective increase or decrease when each parameter increases?

Key idea

Collect partial derivatives into a vector and move in the opposite direction during minimization.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Choose the differentiation variable

    Treat other variables as constants.

  2. 2

    Apply sum, product, and chain rules

    For composition, multiply the outer derivative by the inner derivative.

  3. 3

    Collect partial derivatives into one vector

    ∇f=[∂f/∂x1,…,∂f/∂xN]T\nabla f=[\partial f/\partial x_1,\ldots,\partial f/\partial x_N]^T
  4. 4

    Substitute current values

    Obtain numerical gradient magnitudes and signs.

Worked example

Work through the numbers — Gradient of a one-dimensional loss

The loss squares distance from target value 3.

  1. 1

    Function

    f(w)=(w−3)2f(w)=(w-3)^2
  2. 2

    Derivative

    f′(w)=2(w−3)f'(w)=2(w-3)
  3. 3

    Substitute w=5

    f′(5)=2(5−3)=4f'(5)=2(5-3)=4

Result: The positive gradient 4 means decreasing w reduces loss.

Sanity check

Checks
  • The gradient and parameter vectors must have matching lengths.
  • A constant term has derivative zero.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∂\partialPartial derivative with respect to a particular variable
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · Editorial completion: perceptron gradient Identifier: MAI-P3-144

#Completing the perceptron b gradient

Differentiating equation (1) with respect to b gives the negative label sum.

Completed source placeholder · PDF p. 3

A gradient describes the direction and rate of loss change
∂L∂b=−∑m=1Mym\frac{\partial\mathcal{L}}{\partial b}=-\sum_{m=1}^{M}y_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How much does the objective increase or decrease when each parameter increases?

Key idea

Collect partial derivatives into a vector and move in the opposite direction during minimization.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Choose the differentiation variable

    Treat other variables as constants.

  2. 2

    Apply sum, product, and chain rules

    For composition, multiply the outer derivative by the inner derivative.

  3. 3

    Collect partial derivatives into one vector

    ∇f=[∂f/∂x1,…,∂f/∂xN]T\nabla f=[\partial f/\partial x_1,\ldots,\partial f/\partial x_N]^T
  4. 4

    Substitute current values

    Obtain numerical gradient magnitudes and signs.

Worked example

Work through the numbers — Gradient of a one-dimensional loss

The loss squares distance from target value 3.

  1. 1

    Function

    f(w)=(w−3)2f(w)=(w-3)^2
  2. 2

    Derivative

    f′(w)=2(w−3)f'(w)=2(w-3)
  3. 3

    Substitute w=5

    f′(5)=2(5−3)=4f'(5)=2(5-3)=4

Result: The positive gradient 4 means decreasing w reduces loss.

Sanity check

Checks
  • The gradient and parameter vectors must have matching lengths.
  • A constant term has derivative zero.

Symbols

Symbols used in this equation
SymbolMeaning
∂\partialPartial derivative with respect to a particular variable
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · Editorial completion: bias gradient Identifier: MAI-P3-145

#Completing the MSE gradient

Apply the chain rule to half the squared residual.

Completed source placeholder · PDF p. 4

A gradient describes the direction and rate of loss change
∇w~LMSE=−∑m=1M(ym−w~Tx~m)x~m\nabla_{\widetilde{\mathbf{w}}}\mathcal{L}_{\mathrm{MSE}}=-\sum_{m=1}^{M}\left(y_m-\widetilde{\mathbf{w}}^{\mathsf T}\widetilde{\mathbf{x}}_m\right)\widetilde{\mathbf{x}}_m
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How much does the objective increase or decrease when each parameter increases?

Key idea

Collect partial derivatives into a vector and move in the opposite direction during minimization.

Formula-specific lesson

Alternative MSE learning: residuals, gradients, and step sizes

Sum augmented-vector MSE from a residual table and verify completed gradients and the data-dependent learning-rate bound from Hessian λmax.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Choose the differentiation variable

    Treat other variables as constants.

  2. 2

    Apply sum, product, and chain rules

    For composition, multiply the outer derivative by the inner derivative.

  3. 3

    Collect partial derivatives into one vector

    ∇f=[∂f/∂x1,…,∂f/∂xN]T\nabla f=[\partial f/\partial x_1,\ldots,\partial f/\partial x_N]^T
  4. 4

    Substitute current values

    Obtain numerical gradient magnitudes and signs.

Worked example

Work through the numbers — Gradient of a one-dimensional loss

The loss squares distance from target value 3.

  1. 1

    Function

    f(w)=(w−3)2f(w)=(w-3)^2
  2. 2

    Derivative

    f′(w)=2(w−3)f'(w)=2(w-3)
  3. 3

    Substitute w=5

    f′(5)=2(5−3)=4f'(5)=2(5-3)=4

Result: The positive gradient 4 means decreasing w reduces loss.

Sanity check

Checks
  • The gradient and parameter vectors must have matching lengths.
  • A constant term has derivative zero.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector
∇\nablaA gradient collecting derivatives in each variable direction
∑\sumSum over all specified terms
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 4 · Editorial completion: MSE gradient Identifier: MAI-P3-146

#A data-dependent learning-rate correction

A fixed 0 < α < 2 alone cannot guarantee general MSE convergence. The largest Hessian eigenvalue determines the upper bound.

Mathematically corrected variant · PDF p. 4

Identify the equation's role and symbols
0<α<2λmax⁡(X~X~T),X~=[x~1 ⋯ x~M]0<\alpha<\frac{2}{\lambda_{\max}(\widetilde{\mathbf{X}}\widetilde{\mathbf{X}}^{\mathsf T})},\qquad \widetilde{\mathbf{X}}=[\widetilde{\mathbf{x}}_1\ \cdots\ \widetilde{\mathbf{x}}_M]
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Alternative MSE learning: residuals, gradients, and step sizes

Sum augmented-vector MSE from a residual table and verify completed gradients and the data-dependent learning-rate bound from Hessian λmax.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
X\mathbf{X}Data matrix collecting samples
λ\lambdaRegularization strength or eigenvalue
α\alphaLearning rate, mixture coefficient, or dual coefficient

Reference-quality follow-up

Explore this calculation further
PDF p. 4 · Editorial correction: learning-rate bound Identifier: MAI-P3-147

#Completing XOR’s two-line boundary

Separate points between two parallel lines from those outside using x₁+x₂ to match the source classes.

Completed source placeholder · PDF p. 5

Identify the equation's role and symbols
s=x1+x2,S^(x)={S2,12<s<32,S1,s<12 or s>32.s=x_1+x_2,\qquad \widehat S(\mathbf{x})=\begin{cases}S_2,&\frac12<s<\frac32,\\S_1,&s<\frac12\ \text{or}\ s>\frac32.\end{cases}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

XOR: one line's limits and two hidden thresholds

Project the four XOR points onto s=x1+x2 to examine the need for two parallel boundaries, keeping source blanks separate from editorial completions.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · Editorial completion: XOR geometry Identifier: MAI-P3-148

#Minimum units for XOR

A standard threshold network uses two hidden units and one output unit.

Completed source placeholder · PDF p. 5

Identify the equation's role and symbols
Nhiddenmin⁡=2,Nnoninputmin⁡=3N_{\mathrm{hidden}}^{\min}=2,\qquad N_{\mathrm{noninput}}^{\min}=3
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

XOR: one line's limits and two hidden thresholds

Project the four XOR points onto s=x1+x2 to examine the need for two parallel boundaries, keeping source blanks separate from editorial completions.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · Editorial completion: minimum XOR network Identifier: MAI-P3-149

#Completing weight-matrix equation (6)

Rows correspond to current-layer neurons and columns to previous-layer activations.

Completed source placeholder · PDF p. 7

Matrix multiplication repeats row–column inner products
W(l)=[w1,1(l)w1,2(l)⋯w1,Nl−1(l)w2,1(l)w2,2(l)⋯w2,Nl−1(l)⋮⋮⋱⋮wNl,1(l)wNl,2(l)⋯wNl,Nl−1(l)]∈RNl×Nl−1\mathbf{W}(l)=\begin{bmatrix}w_{1,1}(l)&w_{1,2}(l)&\cdots&w_{1,N_{l-1}}(l)\\w_{2,1}(l)&w_{2,2}(l)&\cdots&w_{2,N_{l-1}}(l)\\\vdots&\vdots&\ddots&\vdots\\w_{N_l,1}(l)&w_{N_l,2}(l)&\cdots&w_{N_l,N_{l-1}}(l)\end{bmatrix}\in\mathbb{R}^{N_l\times N_{l-1}}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · Editorial completion: weight matrix Identifier: MAI-P3-150

#Correcting scalar forward-pass indices

Use N_l for current-layer width and N_{l−1} for previous-layer width.

Mathematically corrected variant · PDF p. 5

Identify the equation's role and symbols
zi(l)=∑j=1Nl−1wi,j(l)aj(l−1)+bi(l),i=1,…,Nlz_i(l)=\sum_{j=1}^{N_{l-1}}w_{i,j}(l)a_j(l-1)+b_i(l),\qquad i=1,\ldots,N_l
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
∑\sumSum over all specified terms

Reference-quality follow-up

Explore this calculation further
PDF p. 5 · Editorial correction: scalar forward pass Identifier: MAI-P3-151

#Correcting vector forward-pass dimensions

Activations, net inputs, and biases all have current-layer width N_l.

Mathematically corrected variant · PDF p. 6

Identify the equation's role and symbols
a(l),z(l),b(l)∈RNl×1,z(l)=W(l)a(l−1)+b(l)\mathbf{a}(l),\mathbf{z}(l),\mathbf{b}(l)\in\mathbb{R}^{N_l\times1},\qquad \mathbf{z}(l)=\mathbf{W}(l)\mathbf{a}(l-1)+\mathbf{b}(l)
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 6 · Editorial correction: matrix forward pass Identifier: MAI-P3-152

#Correcting batch forward-pass dimensions

Separate minibatch column count N_p from current-layer width N_l.

Mathematically corrected variant · PDF p. 7

Identify the equation's role and symbols
A(l),Z(l),B(l)∈RNl×Np,Z(l)=W(l)A(l−1)+B(l)\mathbf{A}(l),\mathbf{Z}(l),\mathbf{B}(l)\in\mathbb{R}^{N_l\times N_p},\qquad \mathbf{Z}(l)=\mathbf{W}(l)\mathbf{A}(l-1)+\mathbf{B}(l)
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

MLP forward: scalar → matrix → batch → softmax

Calculate one 2→3→2 network simultaneously in scalar, matrix, and batch forms, distinguish N_l/N_L notation, and check softmax sums and argmax.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
A\mathbf{A}Linear transformation or coefficient matrix

Reference-quality follow-up

Explore this calculation further
PDF p. 7 · Editorial correction: batch forward pass Identifier: MAI-P3-153

#Completing the flipped 2D kernel

Mathematical 2D convolution rotates the kernel 180° about the origin.

Completed source placeholder · PDF p. 9

A kernel computes feature-space inner products or similarities without constructing that space explicitly
h[−k,−l]=[321642]h[-k,-l]=\begin{bmatrix}3&2&1\\6&4&2\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How can a nonlinear relationship become a similarity score usable by a linear model?

Key idea

Use input distances or feature-space inner products to produce scalar similarity κ(u,v).

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Calculate the difference between inputs

    r=u−vr=u-v
  2. 2

    Calculate squared distance

    ∥r∥22\lVert r\rVert_2^2
  3. 3

    Divide by the kernel-width factor

    ∥r∥22/(2σ2)\lVert r\rVert_2^2/(2\sigma^2)
  4. 4

    Apply a negative exponential for similarity

    κ(u,v)=e−∥u−v∥2/(2σ2)\kappa(u,v)=e^{-\lVert u-v\rVert^2/(2\sigma^2)}

Worked example

Work through the numbers — The RBF kernel

u=[0,0], v=[1,1], and σ=1.

  1. 1

    Squared distance

    (0−1)2+(0−1)2=2(0-1)^2+(0-1)^2=2
  2. 2

    Exponentiation

    e−2/(2⋅12)=e−1≈0.368e^{-2/(2\cdot1^2)}=e^{-1}\approx0.368

Result: The points' RBF similarity is approximately 0.368.

Sanity check

Checks
  • For u=v, the RBF kernel equals one.
  • Very small σ makes most distinct points nearly zero in similarity; very large σ makes them similar.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · Editorial completion: mirrored kernel Identifier: MAI-P3-154

#Completing the full 2D convolution grid

Sum overlapping-entry products at every position to obtain the 5×7 full output.

Completed source placeholder · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
g[m,n]=[0000246000012302612106001365300000000]g[m,n]=\begin{bmatrix}0&0&0&0&2&4&6\\0&0&0&0&1&2&3\\0&2&6&12&10&6&0\\0&1&3&6&5&3&0\\0&0&0&0&0&0&0\end{bmatrix}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · Editorial completion: full 2D convolution Identifier: MAI-P3-155

#Checkerboard response to a moving average

A 3×3 window contains five matching and four opposite signs, leaving one ninth of the original sign.

Completed source placeholder · PDF p. 9

Convolution slides a kernel and repeats elementwise products and sums
g[m,n]=19(−1)m+ng[m,n]=\frac{1}{9}(-1)^{m+n}
Explanation and calculations 5 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How do filter weights summarize each location's neighborhood?

Key idea

Flip and shift the kernel, then sum products of overlapping entries. CNN implementations commonly use unflipped cross-correlation.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check kernel orientation and boundary conditions

    First distinguish mathematical convolution from CNN-style cross-correlation.

  2. 2

    Align the kernel with an output position

    Stride and padding determine the overlapping input region.

  3. 3

    Multiply overlapping entries

    f[k]h[n−k]f[k]h[n-k]
  4. 4

    Sum the products

    g[n]=∑kf[k]h[n−k]g[n]=\sum_k f[k]h[n-k]
  5. 5

    Move to the next position and repeat

    In 2D, perform the same operation over horizontal and vertical indices.

Worked example

Work through the numbers — 1D full convolution

Use signal [1,2,3] and kernel [1,1].

  1. 1

    First position

    1⋅1=11\cdot1=1
  2. 2

    Second position

    1⋅1+2⋅1=31\cdot1+2\cdot1=3
  3. 3

    Third position

    2⋅1+3⋅1=52\cdot1+3\cdot1=5
  4. 4

    Last position

    3⋅1=33\cdot1=3

Result: The full output is [1,3,5,3].

Note: Same or valid padding changes output length.

Sanity check

Checks
  • Output size depends on kernel, padding, stride, and dilation.
  • Keep kernel-flipping conventions consistent between code and equations.

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · Editorial completion: checkerboard response Identifier: MAI-P3-156

#Reduction from separable convolution

Replacing M² operations by 2M gives reduction fraction 1−2/M.

Completed source placeholder · PDF p. 9

Identify the equation's role and symbols
reduction⁡(M)=100(1−2M)%,M≥3⟹reduction⁡≥3313%\operatorname{reduction}(M)=100\left(1-\frac{2}{M}\right)\%,\qquad M\ge3\Longrightarrow\operatorname{reduction}\ge33\frac{1}{3}\%
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

2D convolution exercise·moving average·separability

Use the PDF's exact 2×3 kernel and 4×5 image to complete mirrored-kernel and full-output blanks, checking checkerboard averaging and separability savings.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 9 · Editorial completion: separable saving Identifier: MAI-P3-157

#Correcting f/y in the patch vector

This variant changes y_W(s) to f_W(s), matching the surrounding definition.

Mathematically corrected variant · PDF p. 12

Identify the equation's role and symbols
zsT=[(fW(s))1,(fW(s))2,…,(fW(s))P]\mathbf{z}_s^{\mathsf T}=[(\mathbf{f}_{W(s)})_1,(\mathbf{f}_{W(s)})_2,\ldots,(\mathbf{f}_{W(s)})_P]
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Reference-quality follow-up

Explore this calculation further
PDF p. 12 · Editorial correction: patch vector Identifier: MAI-P3-158

#Correcting the output vector’s last entry

Remove the isolated x and use one consistent s-index rule throughout.

Mathematically corrected variant · PDF p. 13

Matrix multiplication repeats row–column inner products
g=[gs1gs2⋮gsN0]∈RN0\mathbf{g}=\begin{bmatrix}g_{s_1}\\g_{s_2}\\\vdots\\g_{s_{N_0}}\end{bmatrix}\in\mathbb{R}^{N_0}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Synchronized derivation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Reference-quality follow-up

Explore this calculation further
PDF p. 13 · Editorial correction: output vector Identifier: MAI-P3-159

#Completing the 3×3 MaxPool output grid

Calculate source-blank cells with the same window, stride, and padding rules.

Completed source placeholder · PDF p. 15

Matrix multiplication repeats row–column inner products
MaxPool⁡K=3,s=2,p=1(X)=[333332332]\operatorname{MaxPool}_{K=3,s=2,p=1}(\mathbf{X})=\begin{bmatrix}3&3&3\\3&3&2\\3&3&2\end{bmatrix}
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

Which products and sums of inputs form each output entry?

Key idea

Multiply corresponding entries of one left-matrix row and one right-matrix column, then sum.

Formula-specific lesson

Patch matrix → Conv2d → MaxPool

Stack local windows into Z for g=Zh, then check the 64×64 3×3 Conv2d dimensions and parameter count alongside the PDF's 5×5 MaxPool example.

Interactive
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Check multiplication compatibility

    The inner dimensions must agree.

    (m×n)(n×p)→(m×p)(m\times n)(n\times p)\rightarrow(m\times p)
  2. 2

    Choose one output position

    Output entry (i,j) uses row i of A and column j of B.

  3. 3

    Multiply matching indices and sum

    Cij=∑kAikBkjC_{ij}=\sum_k A_{ik}B_{kj}
  4. 4

    Repeat for every row–column pair

    Apply the procedure across the entire output matrix.

Worked example

Work through the numbers — Multiplying a 2×2 matrix by a vector

Use numbers to see how each row transforms the vector.

  1. 1

    Input

    A=[1234],x=[56]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad x=\begin{bmatrix}5\\6\end{bmatrix}
  2. 2

    First row

    1⋅5+2⋅6=171\cdot5+2\cdot6=17
  3. 3

    Second row

    3⋅5+4⋅6=393\cdot5+4\cdot6=39

Result: The result is Ax=[17,39]^T.

Sanity check

Checks
  • Changing multiplication order generally changes the result.
  • Output shape is the outer dimensions m×p.

Symbols

Symbols used in this equation
SymbolMeaning
X\mathbf{X}Data matrix collecting samples

Reference-quality follow-up

Explore this calculation further
PDF p. 15 · Editorial completion: MaxPool output Identifier: MAI-P3-160

#Nonnegativity of MSE loss

The source calls squared-sum loss always positive, but exact fitting permits zero; nonnegative is precise.

Mathematically corrected variant · PDF p. 4

MSE has three steps: residuals, squares, and averaging
LMSE(w~)≥0\mathcal{L}_{\mathrm{MSE}}(\widetilde{\mathbf{w}})\ge 0
Explanation and calculations 4 calculation steps · Numerical example · Checks included · Formula-specific lesson

The question this equation answers

How far are predictions from targets on average?

Key idea

Subtract targets from predictions, square each residual, and divide by sample count. Larger errors receive greater penalties.

Formula-specific lesson

Alternative MSE learning: residuals, gradients, and step sizes

Sum augmented-vector MSE from a residual table and verify completed gradients and the data-dependent learning-rate bound from Hessian λmax.

Structure explanation
Loading the lesson matched to this equation and derivation step.

Calculation walkthrough

Calculation steps
Intermediate calculations included
  1. 1

    Calculate predictions

    For linear regression, predictions are Xw or wᵀx.

    y^=Xw\hat y=Xw
  2. 2

    Calculate residuals

    r=y^−yr=\hat y-y
  3. 3

    Square the residuals

    Remove signs and emphasize larger errors.

    ri2r_i^2
  4. 4

    Sum and divide by sample count

    MSE=1L∑i=1Lri2\mathrm{MSE}=\frac{1}{L}\sum_{i=1}^{L}r_i^2

Worked example

Work through the numbers — MSE for two samples

Compare predictions and targets directly.

  1. 1

    Targets and predictions

    y=[3,1],y^=[2,4]y=[3,1],\quad\hat y=[2,4]
  2. 2

    Residual

    y^−y=[−1,3]\hat y-y=[-1,3]
  3. 3

    Square

    [−1,3]2=[1,9][-1,3]^2=[1,9]
  4. 4

    Average

    (1+9)/2=5(1+9)/2=5

Result: MSE is 5. The second sample's error of 3 substantially increases it.

Sanity check

Checks
  • Check whether the expression divides by sample count or is merely a sum of squares.
  • MSE has squared output units.

Symbols

Symbols used in this equation
SymbolMeaning
w\mathbf{w}Learned weight vector
LLSample count or loss function; check context

Reference-quality follow-up

Explore this calculation further
PDF p. 4 · Editorial correction: MSE nonnegativity Identifier: MAI-P3-161

#Including zero margin in the error set

With labels ±1, g(x)=0 produces sign output zero and is not correct classification. A companion variant extends the initial strict <0 to ≤0.

Mathematically corrected variant · PDF p. 3

Identify the equation's role and symbols
E={xm:ym(wTxm+b)≤0}\mathcal{E}=\{\mathbf{x}_m:y_m(\mathbf{w}^{\mathsf T}\mathbf{x}_m+b)\le 0\}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · Editorial correction: zero-margin error set Identifier: MAI-P3-162

#Including zero margin in each iteration’s error set

For the same reason, iteration-specific error sets should include zero-margin patterns.

Mathematically corrected variant · PDF p. 3

Identify the equation's role and symbols
E(i)={xm:ym((w(i))Txm+b(i))≤0}\mathcal{E}^{(i)}=\{\mathbf{x}_m:y_m((\mathbf{w}^{(i)})^{\mathsf T}\mathbf{x}_m+b^{(i)})\le 0\}
Explanation Core explanation · Formula-specific lesson

The question this equation answers

What does this equation define or connect in the article?

Key idea

For equations without an actual calculation or derivation, briefly clarify context and symbols rather than attaching a generic procedure.

Formula-specific lesson

Perceptron losses, gradients, and error-set updates

For the same ±1-labeled samples, calculate margins, source losses, completed gradients, full-sample updates, and error-set updates. Zero-margin initialization reveals the difference between original <0 and corrected ≤0 sets.

Interactive
Loading the lesson matched to this equation and derivation step.

Symbols

Symbols used in this equation
SymbolMeaning
x\mathbf{x}Input or feature vector
w\mathbf{w}Learned weight vector

Reference-quality follow-up

Explore this calculation further
PDF p. 3 · Editorial correction: iterative zero-margin error set Identifier: MAI-P3-163

#Research update: August 18, 2026

This is not PDF source material. It extends the perceptron, MLP, CNN, and convolution topics through peer-reviewed papers, proceedings, and official implementation documents available by August 18, 2026, without rewriting source claims retroactively.

#1. Activation and normalization extend far beyond ReLU alone

The lectures introduce sign and ReLU. Practice now includes GELU, SiLU/Swish, gated and task-specific activations, while normalization choices include LayerNorm, RMSNorm, GroupNorm, and Global Response Normalization (GRN), selected for architecture and batch regime.

  • BatchNorm — ICML 2015, peer-reviewed: a foundational method stabilizing training through minibatch statistics. PMLR paper
  • RMSNorm — NeurIPS 2019, peer-reviewed: removes recentering and normalizes by root mean square, simplifying LayerNorm computation. Official proceedings
  • ConvNeXt V2 — CVPR 2023, peer-reviewed: jointly designs a fully convolutional masked autoencoder and GRN to strengthen interchannel feature competition. CVF paper
  • Transformers without Normalization — CVPR 2025, peer-reviewed: Dynamic Tanh replaces normalization with an elementwise tanh mapping, reporting comparable or better results in several vision/language settings. This challenges universal necessity claims without providing a universal removal method for all CNNs and MLPs. CVF paper
  • Dynamic Group Normalization — CVPR 2025, peer-reviewed: adapts channel groups during training according to statistics rather than fixing them. CVF paper
  • Stronger Normalization-Free Transformers — CVPR 2026, peer-reviewed: systematically compares pointwise stabilizing functions after DyT, expanding normalization-free design beyond one tanh alternative. CVF paper
  • AcTTA — CVPR 2026, peer-reviewed: adapts ReLU/GELU thresholds and gradient sensitivity at test time rather than relying only on normalization affine parameters, making activations themselves targets of shift adaptation. CVF paper

Evaluate activation and normalization together with gradient scale, residual paths, batch size, pretraining objectives, and hardware kernels, rather than as isolated decorations.

#2. CNN versus Transformer: combining biases and recipes rather than declaring an intrinsically superior operator

  • ConvNeXt — CVPR 2022, peer-reviewed: progressively modernizes ResNet with Transformer-era training and blocks, showing pure ConvNets can compete with Swin-family models. CVF paper
  • ConvNeXt V2 — CVPR 2023: demonstrates joint architecture and self-supervised-pretraining design rather than separate optimization.
  • ShiftwiseConv — CVPR 2025, peer-reviewed: decomposes large-kernel benefits into feature granularity and multipath fusion, building long-range sparse dependencies with small 3×3 kernels. CVF paper
  • MobileNetV4 — ECCV 2024, peer-reviewed: integrates inverted bottlenecks, ConvNeXt, FFNs, and extra depthwise designs in one Universal Inverted Bottleneck search block and evaluates accelerator-aware attention. ECVA paper
  • ConvNeur — CVPR 2026, peer-reviewed: separates global reasoning and locality-preserving representations into gated branches, treating CNNs and attention as complementary roles. CVF paper

Comparisons require matched throughput, latency, memory bandwidth, accelerator mapping, detection/segmentation transfer, pretraining data, and recipes, beyond parameter counts or ImageNet top-1 alone.

#3. Gradient descent selects more than just any minimum: implicit bias and feature learning

Perceptron updates specify a rule, but overparameterized networks admit many equal-training-loss solutions. Selection depends on optimizer, initialization, parameterization, batch size, and weight decay.

  • Soudry et al. — JMLR 2018, peer-reviewed: prove max-margin implicit bias: gradient-descent directions converge to the hard-margin SVM solution in separable logistic regression. JMLR paper
  • Tensor Programs IV — ICML 2021, peer-reviewed: gives parameterization-dependent conditions retaining feature learning rather than a kernel regime at infinite width. PMLR paper
  • Critical feature learning — ICML 2024, peer-reviewed: analyzes wide-network feature-learning regimes through scaling. PMLR paper
  • SGD with Weight Decay Secretly Minimizes the Ranks of Your Neural Networks — CPAL 2025, peer-reviewed: reports theoretical and experimental low-rank bias strengthened by small batches, large learning rates, and strong decay. PMLR paper
  • How Does the ReLU Activation Affect the Implicit Bias… — COLT 2026, peer-reviewed: analyzes conditions for near-minimum-ℓ₂-norm interpolation and rapid activation-pattern stabilization in shallow ReLU regression on high-dimensional random data. Activations and data spectra jointly shape implicit bias. PMLR paper
  • When Both Layers Learn — COLT 2026, peer-reviewed: studies dynamics toward global minima from random initialization and sample complexity when both layers of a one-hidden-layer ReLU network learn, providing a simplified end-to-end feature-learning theory. PMLR paper

Reducing training loss and learning particular representations are separate questions. Extend the lecture’s updates by measuring margins, norms, rank, feature drift, and lazy/rich regimes.

#4. Efficient convolution: from separability to depthwise, grouped, and reparameterized designs

PDF p. 9 reduces M² operations to 2M through separability. Modern CNNs extend efficiency choices into channels.

  • Depthwise convolution filters each channel spatially; pointwise 1×1 convolution mixes channels.
  • Grouped convolution partitions channels to control connections and computation.
  • Structural reparameterization trains multiple branches and algebraically fuses them into one convolution before inference. RepVGG exemplifies this, followed by mobile and large-kernel architectures. RepVGG, CVPR 2021
  • MobileNetV4 codesigns blocks for Pareto frontiers on CPUs, DSPs, GPUs, and NPUs.
  • ShiftwiseConv offers another route to large-kernel effects through small operators.
  • PFGNet — CVPR 2026, peer-reviewed: decomposes spatially adaptive large-kernel responses into separable 1×k and k×1 convolutions, reducing per-channel cost from O(k²) to O(2k). This directly extends classical separability into dynamic receptive-field design. CVF paper

Lower FLOPs do not guarantee lower latency. Measure memory access, kernel launches, fusion, group counts, and target hardware together.

#5. What PyTorch convolution actually computes

The lecture moves from kernel-flipped mathematical convolution to PyTorch Conv2d. Keep these conventions separate.

  • Official PyTorch Conv2d computes valid 2D cross-correlation, without mathematical kernel flipping. Official documentation
  • ConvTranspose2d can be viewed as the input gradient of Conv2d but is not the actual inverse of convolution. With stride greater than one, it inserts zeros between input elements. Official documentation
  • MaxPool2d padding is conceptually negative infinity, preventing zero padding from incorrectly becoming the maximum for negative inputs. Official documentation
  • Dropout zeros elements with a Bernoulli mask during training and scales retained values by 1/(1-p), yielding identity behavior during evaluation. Official documentation

When comparing papers, DSP libraries, and frameworks, specify flipping, padding, tensor layout, groups, dilation, bias, and train/eval mode.

#6. Open research questions

  1. Under matched compute, data, and training, how do CNN/Transformer biases differ for OOD performance, robustness, and dense prediction?
  2. Which activation, residual-scaling, and optimizer conditions maintain stability when normalization changes or is removed?
  3. Which margin, rank, or feature-movement measurements best predict downstream generalization?

#Key terms

  • Perceptron convergence: finite-mistake or convergence properties under linear separability and specified update rules.
  • Feature learning: hidden representations adapting to the task rather than merely fitting linear models over fixed kernels.
  • Structural reparameterization: exactly combining multiple training branches into a single inference operator.
  • Depthwise separable convolution: separating spatial filtering from channel mixing for efficiency.
  • Cross-correlation convention: sliding dot products without kernel flipping, as used in deep-learning frameworks.

Connect