Shen Shen
March 22, 2022
[image credit: 3b1b]
[video credit: 3b1b]
Q: Why do we need a specialized network?
426-by-426 grayscale image
Use the same small network?
need to learn ~3M parameters
Imagine even higher-resolution images, or more complex tasks...
A: Vanilla fully-connected nets don't scale well to (interesting) images
CNN cleverly exploits
to handle images efficiently
via
CNN cleverly exploits
to handle images efficiently
via
cleverly exploits
to handle efficiently
via
Let's move on to the board
to see what a 1D convolution looks like ...
Convolutional layer might sound foreign, but...
Let's move on to the board to see what a 1D convolution looks like ...
Convolutional layer might sound foreign, but...
(and there's even deeper 'similarities', but more on it later)
0
1
0
1
1
-1
1
input image
filter
output image
1
-1
1
0
-1
1
-1
1
(e.g. of size 2)
0
0
0
0
1
1
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
1
1
0
1
0
1
1
-1
1
input image
filter
output image
1
-1
1
0
0
1
0
1
1
-1
1
convolve
with
=
1
-1
1
0
0
0
1
-1
-1
0
0
0
0
0
1
0
0
0
-1
1
0
1
-1
0
0
or dot
with
0
1
0
1
1
0
1
0
1
1
convolve with ?
=
dot-product with ?
=
0
1
0
1
1
0
1
0
1
1
convolve with
dot-product with
1
0
1
0
1
1
-1
1
input image
filter
output image
1
-1
1
0
2D Convolution
input image
filter
output image
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
1
1
0
0
0
0
0
0
1
1
1
1
-1
0 | 1 | -1 | 0 | 0 |
1 | 1 | 0 | 1 | -1 |
1 | 2 | 1 | 0 | 0 |
0 | 2 | 1 | 1 | 0 |
0 | 1 | 1 | 0 | 0 |
A tender intro to tensor:
[image credit: tensorflow]
red
green
blue
image channels
image width
image
height
image channels
image width
image
height
input tensor
filters
outputs
input tensor
filters
output tensor
[image credit: medium]
voter | sex | age | income | education | ... | voted |
---|---|---|---|---|---|---|
1 | F | 30 | 70k | post-grad | ... | Bernie |
2 | M | 75 | 80k | college | ... | Biden |
...
[HW credit: Princeton ORF363]
don't abuse convolution...