|
| 1 | +*** error: more than one subsection in a slide (insert missing !split): |
| 2 | +% !split |
| 3 | +\subsection{Generalizing the above one-dimensional case} |
| 4 | + |
| 5 | +In order to align the above simple case with the more general convolution cases, we rename $\bm{\alpha}$, whose length is $m=3$, with $\bm{w}$. |
| 6 | +We will interpret $\bm{w}$ as a weight/filter function with which we want to perform the convolution with an input varibale $\bm{x}$. |
| 7 | +We replace thus $\bm{\beta}$ with $\bm{x}$ and $\bm{\delta}$ with $\bm{s}$ and have |
| 8 | +\[ |
| 9 | +s(i) \left(x*w\right)(i)= \sum_{k=0}^{k=m-1}w(k)x(i-k), |
| 10 | +\] |
| 11 | +where $m=3$ in our case, the maximum length of the vector $\bm{w}$. |
| 12 | +Here the symbol $*$ represents the mathematical operation of convolution. |
| 13 | + |
| 14 | +\subsection{Two-dimensional Objects} |
| 15 | + |
| 16 | +We are now ready to start studying the discrete convolutions relevant for convolutional neural networks. |
| 17 | +We often use convolutions over more than one dimension at a time. If |
| 18 | +we have a two-dimensional image $X$ as input, we can have a \textbf{filter} |
| 19 | +defined by a two-dimensional \textbf{kernel/weight/filter} $W$. This leads to an output $Y$ |
| 20 | + |
| 21 | +\[ |
| 22 | +Y(i,j)=(X * W)(i,j) = \sum_m\sum_n X(m,n)W(i-m,j-n). |
| 23 | +\] |
| 24 | + |
| 25 | +Convolution is a commutative process, which means we can rewrite this equation as |
| 26 | +\[ |
| 27 | +Y(i,j)=(X * W)(i,j) = \sum_m\sum_n X(i-m,j-n)W(m,n). |
| 28 | +\] |
| 29 | + |
| 30 | +Normally the latter is more straightforward to implement in a machine larning library since there is less variation in the range of values of $m$ and $n$. |
| 31 | + |
| 32 | +Many deep learning libraries implement cross-correlation instead of convolution (although it is referred to s convolution) |
| 33 | +Y(i,j)=(X * W)(i,j) = \sum_m\sum_n X(i+m,j+n)W(m,n). |
| 34 | +\] |
| 35 | + |
| 36 | + |
0 commit comments