From 603bfb033be9915aa79143aadc4ce690f7772d87 Mon Sep 17 00:00:00 2001 From: Taksh Date: Wed, 24 Jun 2026 16:04:37 +0530 Subject: [PATCH] Fix wrong axis in conv-layer finite-difference formulas. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The [1, -1] kernel is 1×2 and runs along columns, so the difference is horizontal (j), not vertical (i). Co-authored-by: Cursor --- chapter_convolutional-neural-networks/conv-layer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter_convolutional-neural-networks/conv-layer.md b/chapter_convolutional-neural-networks/conv-layer.md index a9f64544e2..715417026f 100644 --- a/chapter_convolutional-neural-networks/conv-layer.md +++ b/chapter_convolutional-neural-networks/conv-layer.md @@ -282,7 +282,7 @@ Next, we construct a kernel `K` with a height of 1 and a width of 2. When we perform the cross-correlation operation with the input, if the horizontally adjacent elements are the same, the output is 0. Otherwise, the output is nonzero. -Note that this kernel is a special case of a finite difference operator. At location $(i,j)$ it computes $x_{i,j} - x_{(i+1),j}$, i.e., it computes the difference between the values of horizontally adjacent pixels. This is a discrete approximation of the first derivative in the horizontal direction. After all, for a function $f(i,j)$ its derivative $-\partial_i f(i,j) = \lim_{\epsilon \to 0} \frac{f(i,j) - f(i+\epsilon,j)}{\epsilon}$. Let's see how this works in practice. +Note that this kernel is a special case of a finite difference operator. At location $(i,j)$ it computes $x_{i,j} - x_{i,j+1}$, i.e., it computes the difference between the values of horizontally adjacent pixels. This is a discrete approximation of the first derivative in the horizontal direction. After all, for a function $f(i,j)$ its derivative $-\partial_j f(i,j) = \lim_{\epsilon \to 0} \frac{f(i,j) - f(i,j+\epsilon)}{\epsilon}$. Let's see how this works in practice. ```{.python .input} %%tab all