\relax \providecommand\hyper@newdestlabel[2]{} \providecommand\HyField@AuxAddToFields[1]{} \providecommand\HyField@AuxAddToCoFields[2]{} \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces The one idea, and what a CNN is built from. Full architecture with layer sizes: Figure~\ref {fig:lenet}.}}{1}{figure.1}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {1}Recap and the Big Picture: an MLP Looking at an Image}{3}{section.1}\protected@file@percent } \newlabel{sec:overview}{{1}{3}{Recap and the Big Picture: an MLP Looking at an Image}{section.1}{}} \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces LeNet on a Fashion-MNIST image. Each box is the tensor between layers (channels $\times $ height $\times $ width).}}{3}{figure.2}\protected@file@percent } \newlabel{fig:lenet}{{2}{3}{LeNet on a Fashion-MNIST image. Each box is the tensor between layers (channels $\times $ height $\times $ width)}{figure.2}{}} \@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces The parts of a CNN. Five are reused; four are new.}}{4}{table.1}\protected@file@percent } \newlabel{tab:parts}{{1}{4}{The parts of a CNN. Five are reused; four are new}{table.1}{}} \@writefile{toc}{\contentsline {section}{\numberline {2}Cross-Correlation: One Kernel Slid over the Image}{4}{section.2}\protected@file@percent } \newlabel{sec:conv}{{2}{4}{Cross-Correlation: One Kernel Slid over the Image}{section.2}{}} \newlabel{eq:corr}{{1}{4}{Cross-Correlation: One Kernel Slid over the Image}{equation.1}{}} \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Cross-correlation: the shaded window of $X$ times $K$, summed, gives the shaded output.}}{5}{figure.3}\protected@file@percent } \newlabel{fig:corr}{{3}{5}{Cross-correlation: the shaded window of $X$ times $K$, summed, gives the shaded output}{figure.3}{}} \@writefile{toc}{\contentsline {paragraph}{What a kernel detects.}{5}{section*.3}\protected@file@percent } \@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces A vertical-edge kernel. White = 1, black = 0 in the images; red $=+1$, blue $=-1$ in the edge maps. Shifting the image shifts the edge map by the same amount.}}{5}{figure.4}\protected@file@percent } \newlabel{fig:edges}{{4}{5}{A vertical-edge kernel. White = 1, black = 0 in the images; red $=+1$, blue $=-1$ in the edge maps. Shifting the image shifts the edge map by the same amount}{figure.4}{}} \@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Three well-known $3\times 3$ kernels, each applied to the same image. Edge detection responds only where the brightness changes (flat regions give zero, shown black); sharpening is the identity plus a bit of that edge response; blurring is a weighted local average. A CNN does not get these --- it \emph {learns} the nine numbers, and \S \ref {sec:conv} already showed gradient descent recovering an edge detector on its own.}}{6}{figure.5}\protected@file@percent } \newlabel{fig:classic}{{5}{6}{Three well-known $3\times 3$ kernels, each applied to the same image. Edge detection responds only where the brightness changes (flat regions give zero, shown black); sharpening is the identity plus a bit of that edge response; blurring is a weighted local average. A CNN does not get these --- it \emph {learns} the nine numbers, and \S \ref {sec:conv} already showed gradient descent recovering an edge detector on its own}{figure.5}{}} \@writefile{toc}{\contentsline {paragraph}{Padding.}{6}{section*.4}\protected@file@percent } \@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces \textbf {Padding.} The grey ring is the added zeros. With it the window can sit over the corners, so the output grows from $2\times 2$ back to $4\times 4$ --- and the unpadded result $\left [\begin {smallmatrix}19&25\\37&43\end {smallmatrix}\right ]$ now sits in the middle of it, surrounded by the border outputs that were previously impossible to compute.}}{6}{figure.6}\protected@file@percent } \newlabel{fig:padding}{{6}{6}{\textbf {Padding.} The grey ring is the added zeros. With it the window can sit over the corners, so the output grows from $2\times 2$ back to $4\times 4$ --- and the unpadded result $\left [\begin {smallmatrix}19&25\\37&43\end {smallmatrix}\right ]$ now sits in the middle of it, surrounded by the border outputs that were previously impossible to compute}{figure.6}{}} \@writefile{toc}{\contentsline {paragraph}{Stride.}{7}{section*.5}\protected@file@percent } \newlabel{eq:outsize}{{2}{7}{Stride}{equation.2}{}} \@writefile{lof}{\contentsline {figure}{\numberline {7}{\ignorespaces \textbf {Stride.} Only four window positions are evaluated, one per colour, and each produces the matching output cell. Middle row and last column are skipped entirely --- that is what makes the output small. Two of the four: $0{\cdot }0+0{\cdot }1+1{\cdot }2+2{\cdot }3=8$ (teal) and $0{\cdot }0+6{\cdot }1+0{\cdot }2+0{\cdot }3=6$ (violet).}}{7}{figure.7}\protected@file@percent } \newlabel{fig:stride}{{7}{7}{\textbf {Stride.} Only four window positions are evaluated, one per colour, and each produces the matching output cell. Middle row and last column are skipped entirely --- that is what makes the output small. Two of the four: $0{\cdot }0+0{\cdot }1+1{\cdot }2+2{\cdot }3=8$ (teal) and $0{\cdot }0+6{\cdot }1+0{\cdot }2+0{\cdot }3=6$ (violet)}{figure.7}{}} \@writefile{toc}{\contentsline {section}{\numberline {3}Channels, and Convolution as One Matrix Product}{7}{section.3}\protected@file@percent } \newlabel{sec:channels}{{3}{7}{Channels, and Convolution as One Matrix Product}{section.3}{}} \@writefile{toc}{\contentsline {paragraph}{Several input channels.}{7}{section*.6}\protected@file@percent } \@writefile{lof}{\contentsline {figure}{\numberline {8}{\ignorespaces \textbf {Several input channels.} Each input channel gets its own kernel; the two results are \emph {added}, so two channels in still give one map out. Nothing in the output records which channel contributed what. To get $c_o$ output maps, repeat the whole picture $c_o$ times with different kernels --- hence $c_i c_o$ kernels in total, and why every output channel depends on \emph {every} input channel.}}{8}{figure.8}\protected@file@percent } \newlabel{fig:channels}{{8}{8}{\textbf {Several input channels.} Each input channel gets its own kernel; the two results are \emph {added}, so two channels in still give one map out. Nothing in the output records which channel contributed what. To get $c_o$ output maps, repeat the whole picture $c_o$ times with different kernels --- hence $c_i c_o$ kernels in total, and why every output channel depends on \emph {every} input channel}{figure.8}{}} \@writefile{toc}{\contentsline {paragraph}{Several output channels.}{8}{section*.7}\protected@file@percent } \newlabel{eq:conv4}{{3}{8}{Several output channels}{equation.3}{}} \@writefile{toc}{\contentsline {paragraph}{Convolution as one matrix product (``unfold'', also called im2col).}{8}{section*.8}\protected@file@percent } \newlabel{eq:unfold}{{4}{8}{Convolution as one matrix product (``unfold'', also called im2col)}{equation.4}{}} \@writefile{toc}{\contentsline {section}{\numberline {4}Pooling: Shrink, and Forgive Small Moves}{9}{section.4}\protected@file@percent } \newlabel{sec:pool}{{4}{9}{Pooling: Shrink, and Forgive Small Moves}{section.4}{}} \@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces \textbf {Pooling.} The shaded window produces the shaded output cell. Max keeps the strongest response in the window, average smears it. The layer has no weights at all: nothing here is learned. (Drawn with stride 1 so it lines up with the convolution examples above; PyTorch's default stride equals the window size, which is what actually shrinks the map --- $3\times 3\to 2\times 2$ here, $28\times 28\to 14\times 14$ in LeNet.)}}{9}{figure.9}\protected@file@percent } \newlabel{fig:pooling}{{9}{9}{\textbf {Pooling.} The shaded window produces the shaded output cell. Max keeps the strongest response in the window, average smears it. The layer has no weights at all: nothing here is learned. (Drawn with stride 1 so it lines up with the convolution examples above; PyTorch's default stride equals the window size, which is what actually shrinks the map --- $3\times 3\to 2\times 2$ here, $28\times 28\to 14\times 14$ in LeNet.)}{figure.9}{}} \@writefile{toc}{\contentsline {section}{\numberline {5}LeNet, Then and Now}{10}{section.5}\protected@file@percent } \newlabel{sec:lenet}{{5}{10}{LeNet, Then and Now}{section.5}{}} \@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces LeNet-5 (LeCun et al., 1998). Each grey stack is one channel of a feature map, so the stacks get \emph {thicker} (more channels) and \emph {smaller} (pooling) from left to right --- 6@28$\times $28, then 6@14$\times $14, then 16@10$\times $10, then 16@5$\times $5 --- before the three dense layers at the right turn 400 numbers into 10 class scores. The faint lines trace one output cell back to the window that produced it.}}{10}{figure.10}\protected@file@percent } \newlabel{fig:lenet5}{{10}{10}{LeNet-5 (LeCun et al., 1998). Each grey stack is one channel of a feature map, so the stacks get \emph {thicker} (more channels) and \emph {smaller} (pooling) from left to right --- 6@28$\times $28, then 6@14$\times $14, then 16@10$\times $10, then 16@5$\times $5 --- before the three dense layers at the right turn 400 numbers into 10 class scores. The faint lines trace one output cell back to the window that produced it}{figure.10}{}} \@writefile{toc}{\contentsline {paragraph}{1998 vs today.}{11}{section*.9}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {6}Batch Normalization}{11}{section.6}\protected@file@percent } \newlabel{sec:bn}{{6}{11}{Batch Normalization}{section.6}{}} \@writefile{toc}{\contentsline {paragraph}{The problem.}{11}{section*.10}\protected@file@percent } \@writefile{toc}{\contentsline {paragraph}{The fix: standardize inside the network.}{12}{section*.11}\protected@file@percent } \newlabel{eq:bnstats}{{5}{12}{The fix: standardize inside the network}{equation.5}{}} \newlabel{eq:bn}{{6}{12}{The fix: standardize inside the network}{equation.6}{}} \@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces Which values are averaged together. Batch norm: down a column (per channel). Layer norm (HW7's Transformers): along a row (per example).}}{12}{figure.11}\protected@file@percent } \newlabel{fig:axes}{{11}{12}{Which values are averaged together. Batch norm: down a column (per channel). Layer norm (HW7's Transformers): along a row (per example)}{figure.11}{}} \@writefile{toc}{\contentsline {paragraph}{Training mode and evaluation mode.}{13}{section*.12}\protected@file@percent } \@writefile{toc}{\contentsline {paragraph}{What it buys.}{13}{section*.13}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {7}Going Deeper: Residual Blocks}{13}{section.7}\protected@file@percent } \newlabel{sec:res}{{7}{13}{Going Deeper: Residual Blocks}{section.7}{}} \@writefile{toc}{\contentsline {paragraph}{The idea.}{13}{section*.14}\protected@file@percent } \newlabel{eq:res}{{7}{13}{The idea}{equation.7}{}} \@writefile{lof}{\contentsline {figure}{\numberline {12}{\ignorespaces A residual block.}}{14}{figure.12}\protected@file@percent } \newlabel{fig:resblock}{{12}{14}{A residual block}{figure.12}{}} \@writefile{toc}{\contentsline {paragraph}{When shapes change.}{14}{section*.15}\protected@file@percent } \@writefile{toc}{\contentsline {paragraph}{Why pooling stays outside.}{14}{section*.16}\protected@file@percent } \@writefile{toc}{\contentsline {paragraph}{The small ResNet of HW6.}{14}{section*.17}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {8}Training CNNs on Little Data: Augmentation and Transfer}{15}{section.8}\protected@file@percent } \newlabel{sec:little}{{8}{15}{Training CNNs on Little Data: Augmentation and Transfer}{section.8}{}} \@writefile{toc}{\contentsline {paragraph}{Data augmentation.}{15}{section*.18}\protected@file@percent } \@writefile{lof}{\contentsline {figure}{\numberline {13}{\ignorespaces One CIFAR-10 training image and eight random flip + crop draws. The padded border shows as black here; the notebook pads the \emph {standardized} images, so there the border is the average colour.}}{15}{figure.13}\protected@file@percent } \newlabel{fig:aug}{{13}{15}{One CIFAR-10 training image and eight random flip + crop draws. The padded border shows as black here; the notebook pads the \emph {standardized} images, so there the border is the average colour}{figure.13}{}} \@writefile{toc}{\contentsline {paragraph}{Transfer learning.}{15}{section*.19}\protected@file@percent } \@writefile{lof}{\contentsline {figure}{\numberline {14}{\ignorespaces Three ways to use 5,000 labelled images. Grey = frozen pretrained weights; blue = pretrained and trainable; red = random and trainable; green = a new 10-class output layer.}}{15}{figure.14}\protected@file@percent } \newlabel{fig:transfer}{{14}{15}{Three ways to use 5,000 labelled images. Grey = frozen pretrained weights; blue = pretrained and trainable; red = random and trainable; green = a new 10-class output layer}{figure.14}{}} \@writefile{toc}{\contentsline {section}{\numberline {9}HW6 Map: Problems 1, 2 and 6}{16}{section.9}\protected@file@percent } \newlabel{sec:hwmap}{{9}{16}{HW6 Map: Problems 1, 2 and 6}{section.9}{}} \@writefile{toc}{\contentsline {paragraph}{Common bugs.}{16}{section*.20}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {10}Where This Leads}{17}{section.10}\protected@file@percent } \newlabel{sec:forward}{{10}{17}{Where This Leads}{section.10}{}} \gdef \@abspage@last{17}