SlideShare a Scribd company logo
Convolution as matrix
multiplication
• Edwin Efraín Jiménez Lepe
16 24 32
47 18 26
68 12 9
Input
0 1
-1 0
2 3
4 5
W1
W2
∗
=
16 47 24 18
47 68 18 12
24 18 32 26
18 12 26 9
Im2col (input)
0 5
1 3
-1 4
0 2
x
W1 W2
=
23 353
50 535
-14 354
-14 248
Rearrange
23 -14
50 -14
353 354
535 248
FeedForward
Applying kernel rotation
16 24 32
47 18 26
68 12 9
Input
0 1
-1 0
2 3
4 5
W1
W2
∗
=
16 47 24 18
47 68 18 12
24 18 32 26
18 12 26 9
Im2col (input)
0 5
1 3
-1 4
0 2
x
W1 W2
=
23 353
50 535
-14 354
-14 248
Rearrange
24 -13
51 -13
353 354
535 248
Now with bias
1
1
1
1
1 0
FeedForward
16 24 32
47 18 26
68 12 9
Input
0 0
-2.94504954e-05 0
d_y
∗ =
16 47 24 18
47 68 18 12
24 18 32 26
18 12 26 9
Im2col (input)
0 0
-2e-05 6e-06
0 0
0 0
x
Im2col(d_y)
-1.38417328e-03 3.00583533
e-04
-2.00263369e-03 4.34886814
e-04
-5.30108917e-04 1.15117098
e-04
-3.53405945e-04 7.67447318
e-05
Rearrange
-1.38417328e-03 -5.30108917e-04
-2.00263369e-03 3.53405945e-04
d_w = input * d_y
The update correspond to the
Rotated kernel
BackPropagation
d_w
0 0
6.39539432e-06 0
-1.38417328e-03 -5.30108917e-04
-2.00263369e-03 3.53405945e-04
0 0
-2.94504954e-05 0
d_y
d_x = d_y * w (without rotation)
BackPropagation
0 0
-6.39539432e-06 0
We need full convolution
And keep kernel unrotated
0 0 0 0
0 0 0 0
0 -2.94504954e-05 0 0
0 0 0 0
d_y
0 0 0 0
0 0 0 0
0 6.39539432e-06 0 0
0 0 0 0
0 1
-1 0
2 3
4 5
W1
W2
∗
0 1
-1 0
2 3
4 5
W1
W2
∗
d_x = d_y * w (without rotation)
BackPropagation
0 0 0 0
0 0 0 0
0 -2.94504954e-05 0 0
0 0 0 0
d_y
0 0 0 0
0 0 0 0
0 6.39539432e-06 0 0
0 0 0 0
=
0 1
-1 0
2 3
4 5
W1
W2
∗
0 0 0 0 0 -2.94e-05 0 0 0
0 0 0 0 -2.94e-05 0 0 0 0
0 0 -2.94e-05 0 0 0 0 0 0
0 -2.94e-05 0 0 0 0 0 0 0
0
-1
1
0
x
0 0 0 0 0 6.395e-06 0 0 0
0 0 0 0 6.395e-06 0 0 0 0
0 0 6.395e-06 0 0 0 0 0 0
0 6.395e-06 0 0 0 0 0 0 0
2
4
3
5
x
T
T
d_x = d_y * w (without rotation)
BackPropagation
0 0 0 0 0 -2.94e-05 0 0 0
0 0 0 0 -2.94e-05 0 0 0 0
0 0 -2.94e-05 0 0 0 0 0 0
0 -2.94e-05 0 0 0 0 0 0 0
0
-1
1
0
x
0 0 0 0 0 6.395e-06 0 0 0
0 0 0 0 6.395e-06 0 0 0 0
0 0 6.395e-06 0 0 0 0 0 0
0 6.395e-06 0 0 0 0 0 0 0
2
4
3
5
x
T
T
=
0
0
-0.2945e-04
0
0.2945e-04
0
0
0
0
0
0.3198e-04
0.1919-04
0
0.2558-04
0.1279-04
0
0
0
d_x = d_y * w (without rotation)
BackPropagation
0
0
-0.2945e-04
0
0.2945e-04
0
0
0
0
0
0.3198e-04
0.1919-04
0
0.2558-04
0.1279-04
0
0
0
+ =
0
0.3198e-04
-0.1026e-04
0
0.5503e-04
0.1279-04
0
0
0
reshape
0 0 0
0.3198e-04 0.5503e-04 0
-0.1026e-04 0.1279-04 0
d_x = d_y * w (without rotation)
BackPropagation
0 0 0 0 0 -2.94e-05 0 0 0
0 0 0 0 -2.94e-05 0 0 0 0
0 0 -2.94e-05 0 0 0 0 0 0
0 -2.94e-05 0 0 0 0 0 0 0
0
-1
1
0
x
0 0 0 0 0 6.395e-06 0 0 0
0 0 0 0 6.395e-06 0 0 0 0
0 0 6.395e-06 0 0 0 0 0 0
0 6.395e-06 0 0 0 0 0 0 0
2
4
3
5
T
=
In fact, we can do it in just one operation
0
0.3198e-04
-0.1026e-04
0
0.5503e-04
0.1279-04
0
0
0
Notice, every channel of delta is multiplied
by the correspondent filter that generates it
A multi-channel example
16 24 32
47 18 26
68 12 9
Input
26 57 43
24 21 12
02 11 19
18 47 21
4 6 12
81 22 13
0 1
-1 0
2 3
4 5
Filter 1 Filter 2
∗
-2 68
24 16
18 32
22 60
23 7
46 35
42 20
81 78
(3,3,3) (2,3,2,2)
Output= (2,2,2)
=
2171 2170
5954 2064
13042 13575
11023 6425
Applying theano convolution (which rotates
Automatically the filters)
A multi-channel example (vectorized)
16 24 32
47 18 26
68 12 9
Input
26 57 43
24 21 12
02 11 19
18 47 21
4 6 12
81 22 13
0 1
-1 0
2 3
4 5
Filter 1 Filter 2
∗
-2 68
24 16
18 32
22 60
23 7
46 35
42 20
81 78
(3,3,3) (2,3,2,2)
=
16 47 24 18
47 68 18 12
24 18 32 26
18 12 26 9
26 24 57 21
24 2 21 11
57 21 43 12
21 11 12 19
18 4 47 6
4 81 6 22
47 6 21 12
6 22 12 13
0 60
1 32
-1 22
0 18
5 35
3 7
4 46
2 23
16 78
68 20
24 81
-2 42
x
T
A multi-channel example (vectorized)
16 47 24 18
47 68 18 12
24 18 32 26
18 12 26 9
26 24 57 21
24 2 21 11
57 21 43 12
21 11 12 19
18 4 47 6
4 81 6 22
47 6 21 12
6 22 12 13
x =
T
0 60
1 32
-1 22
0 18
5 35
3 7
4 46
2 23
16 78
68 20
24 81
-2 42
2171 13042
5954 11023
2170 13575
2064 6425
Channel 1
Channel 2
Rearrange
2171 2170
5954 2064
13042 13575
11023 6425
Backpropagation
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
Imagine we got the next error
from an up-layer
And we want to propagate it to
the correspondent layer (input of convolution)
We need to compute d_y * w (without rotation)
But is a ‘full’ convolution, so we add 1 zero padding to d_y
0 0 0 0
0 .1678 .098 0
0 .002 .246 0
0 0 0 0
0 0 0 0
0 0.5 .67 0
0 .21 .487 0
0 0 0 0
Backpropagation d_y-1=d_y * w (without rotation)
0 0 0 0
0 .1678 .098 0
0 .002 .246 0
0 0 0 0
0 0 0 0
0 0.5 .67 0
0 .21 .487 0
0 0 0 0
im2col
0 0 0 0 .1678 .002 0 .098 .246
0 0 0 .1678 .002 0 .098 .246 0
0 .1678 .002 0 .098 .246 0 0 0
.1678 .002 0 .098 .246 0 0 0 0
0 0 0 0 .5 .21 0 .67 .487
0 0 0 .5 .21 0 .67 .487 0
0 .5 .21 0 .67 .487 0 0 0
.5 .21 0 .67 .487 0 0 0 0
Backpropagation d_y-1=d_y * w (without rotation)
0 0 0 0 .1678 .002 0 .098 .246
0 0 0 .1678 .002 0 .098 .246 0
0 .1678 .002 0 .098 .246 0 0 0
.1678 .002 0 .098 .246 0 0 0 0
0 0 0 0 .5 .21 0 .67 .487
0 0 0 .5 .21 0 .67 .487 0
0 .5 .21 0 .67 .487 0 0 0
.5 .21 0 .67 .487 0 0 0 0
T
Notice, every channel of delta is multiplied
by the correspondent filter that generates it
0
-1
1
0
2
4
3
5
-2
24
68
16
18
22
32
60
23
46
7
35
42
81
20
78
x =
30 18.339 41.6848
28.7678 11.3634 37.8224
6.722 1.476 4.336
51.0322 47.6112 98.3552
64.376 44.7626 99.7084
19.61 8.981 35.284
14.642 31.212 56.622
22.528 38.992 73.295
8.766 11.693 19.962
Backpropagation d_y-1=d_y * w (without rotation)
30 18.339 41.6848
28.7678 11.3634 37.8224
6.722 1.476 4.336
51.0322 47.6112 98.3552
64.376 44.7626 99.7084
19.61 8.981 35.284
14.642 31.212 56.622
22.528 38.992 73.295
8.766 11.693 19.962
rearrange
30 51.0322 14.642
28.7678 64.376 22.528
6.722 19.61 8.766
18.339 47.6112 31.212
11.3634 44.7626 38.992
1.476 8.981 11.693
41.6848 98.3552 56.622
37.8224 99.7084 73.295
4.336 35.284 19.962
Backpropagation (no vectorized) d_y-1=d_y * w (without rotation)
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
(2,2,2)
0 1
-1 0
2 3
4 5
Filter 1 Filter 2
∗
-2 68
24 16
18 32
22 60
23 7
46 35
42 20
81 78
(2,3,2,2)
Transpose
dimensions
0 and 1
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
(2,2,2)
0 1
-1 0
2 3
4 5
Filter 1 Filter 2
∗
-2 68
24 16
18 32
22 60
23 7
46 35
42 20
81 78
(3,2,2,2)
Filter 3
Backpropagation (no vectorized, full convolution)
d_y-1=d_y * w (without rotation)
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
(2,2,2)
0 1
-1 0
2 3
4 5
Filter 1 Filter 2
∗
-2 68
24 16
18 32
22 60
23 7
46 35
42 20
81 78
(3,2,2,2)
Filter 3
=
30 51.0322 14.642
28.7678 64.376 22.528
6.722 19.61 8.766
18.339 47.6112 31.212
11.3634 44.7626 38.992
1.476 8.981 11.693
41.6848 98.3552 56.622
37.8224 99.7084 73.295
4.336 35.284 19.962
Backpropagation
d_w=input * d_y16 24 32
47 18 26
68 12 9
Input
26 57 43
24 21 12
02 11 19
18 47 21
4 6 12
81 22 13
(3,3,3)
∗
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
=
d_y
(2,2,2)
Dimensions do not match,
So it is telling us that we need to
Apply both filters to any cannel of the input
16 24 32
47 18 26
68 12 9
∗
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
=
9.5588 13.5952
12.7386 7.8064
42.716 49.882
55.684 33.323
26 57 43
24 21 12
02 11 19
∗
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
=
15.1628 16.7726
8.7952 9.3958
66.457 67.564
31.847 30.103
∗
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
=
9.1104 12.9086
6.8332 5.4248
44.252 44.674
33.744 21.991
18 47 21
4 6 12
81 22 13
Backpropagation d_w=input * d_y
=
33.832 43.2764
28.367 22.627
153.425 162.12
121.275 85.417
Error associated with rotated kernel, it means
We need to rotate this result to update the
unrotated kernel
9.5588 13.5952
12.7386 7.8064
42.716 49.882
55.684 33.323
15.1628 16.7726
8.7952 9.3958
66.457 67.564
31.847 30.103
9.1104 12.9086
6.8332 5.4248
44.252 44.674
33.744 21.991
+
+
Backpropagation vectorized d_w=input * d_y (without rotate d_y)
16 24 32
47 18 26
68 12 9
Input
26 57 43
24 21 12
02 11 19
18 47 21
4 6 12
81 22 13
(3,3,3)
∗
.1678 .098
.002 .246
0.5 0.67
0.21 0.487
=
d_y
(2,2,2)
Dimensions do not match,
So it is telling us that we need to
Apply both filters to any cannel of the input
16 47 24 18
47 68 18 12
24 18 32 26
18 12 26 9
26 24 57 21
24 2 21 11
57 21 43 12
21 11 12 19
18 4 47 6
4 81 6 22
47 6 21 12
6 22 12 13
T
x
.1678 0.5
.002 0.21
.098 0.67
.246 0.487
.1678 0.5
.002 0.21
.098 0.67
.246 0.487
.1678 0.5
.002 0.21
.098 0.67
.246 0.487
Backpropagation vectorized d_w=input * d_y (without rotate d_y)
16 47 24 18
47 68 18 12
24 18 32 26
18 12 26 9
26 24 57 21
24 2 21 11
57 21 43 12
21 11 12 19
18 4 47 6
4 81 6 22
47 6 21 12
6 22 12 13
T
x
.1678 0.5
.002 0.21
.098 0.67
.246 0.487
.1678 0.5
.002 0.21
.098 0.67
.246 0.487
.1678 0.5
.002 0.21
.098 0.67
.246 0.487
=
33.832 153.425
28.367 121.275
43.2764 162.12
22.627 85.417
33.832 43.2764
28.367 22.627
153.425 162.12
121.275 85.417
rearrange

More Related Content

What's hot

Chapter 13 Linear Factor Models
Chapter 13 Linear Factor ModelsChapter 13 Linear Factor Models
Chapter 13 Linear Factor Models
KyeongUkJang
 
Backpropagation algo
Backpropagation  algoBackpropagation  algo
Deep Generative Models
Deep Generative ModelsDeep Generative Models
Deep Generative Models
Mijung Kim
 
RM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lectureRM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lecture
VIT University (Chennai Campus)
 
Flowchart of GA
Flowchart of GAFlowchart of GA
Flowchart of GA
Ishucs
 
Deep Generative Models
Deep Generative Models Deep Generative Models
Deep Generative Models
Chia-Wen Cheng
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
Krish Everglades
 
Feed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descentFeed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descent
Muhammad Rasel
 
Manifold learning with application to object recognition
Manifold learning with application to object recognitionManifold learning with application to object recognition
Manifold learning with application to object recognitionzukun
 
Deep Learning for Computer Vision: Generative models and adversarial training...
Deep Learning for Computer Vision: Generative models and adversarial training...Deep Learning for Computer Vision: Generative models and adversarial training...
Deep Learning for Computer Vision: Generative models and adversarial training...
Universitat Politècnica de Catalunya
 
[PR12] Generative Models as Distributions of Functions
[PR12] Generative Models as Distributions of Functions[PR12] Generative Models as Distributions of Functions
[PR12] Generative Models as Distributions of Functions
JaeJun Yoo
 
Wasserstein GAN
Wasserstein GANWasserstein GAN
Wasserstein GAN
Bar Vinograd
 
Masked Autoencoders Are Scalable Vision Learners.pptx
Masked Autoencoders Are Scalable Vision Learners.pptxMasked Autoencoders Are Scalable Vision Learners.pptx
Masked Autoencoders Are Scalable Vision Learners.pptx
Sangmin Woo
 
Optimization/Gradient Descent
Optimization/Gradient DescentOptimization/Gradient Descent
Optimization/Gradient Descent
kandelin
 
Self-supervised Learning Lecture Note
Self-supervised Learning Lecture NoteSelf-supervised Learning Lecture Note
Self-supervised Learning Lecture Note
Sangwoo Mo
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
Amit Kumar Rathi
 
Steffen Rendle, Research Scientist, Google at MLconf SF
Steffen Rendle, Research Scientist, Google at MLconf SFSteffen Rendle, Research Scientist, Google at MLconf SF
Steffen Rendle, Research Scientist, Google at MLconf SF
MLconf
 
Back propagation
Back propagationBack propagation
Back propagation
Nagarajan
 
Back propagation method
Back propagation methodBack propagation method
Back propagation method
Prof. Neeta Awasthy
 
Evolution of the StyleGAN family
Evolution of the StyleGAN familyEvolution of the StyleGAN family
Evolution of the StyleGAN family
Vitaly Bondar
 

What's hot (20)

Chapter 13 Linear Factor Models
Chapter 13 Linear Factor ModelsChapter 13 Linear Factor Models
Chapter 13 Linear Factor Models
 
Backpropagation algo
Backpropagation  algoBackpropagation  algo
Backpropagation algo
 
Deep Generative Models
Deep Generative ModelsDeep Generative Models
Deep Generative Models
 
RM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lectureRM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lecture
 
Flowchart of GA
Flowchart of GAFlowchart of GA
Flowchart of GA
 
Deep Generative Models
Deep Generative Models Deep Generative Models
Deep Generative Models
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
Feed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descentFeed forward ,back propagation,gradient descent
Feed forward ,back propagation,gradient descent
 
Manifold learning with application to object recognition
Manifold learning with application to object recognitionManifold learning with application to object recognition
Manifold learning with application to object recognition
 
Deep Learning for Computer Vision: Generative models and adversarial training...
Deep Learning for Computer Vision: Generative models and adversarial training...Deep Learning for Computer Vision: Generative models and adversarial training...
Deep Learning for Computer Vision: Generative models and adversarial training...
 
[PR12] Generative Models as Distributions of Functions
[PR12] Generative Models as Distributions of Functions[PR12] Generative Models as Distributions of Functions
[PR12] Generative Models as Distributions of Functions
 
Wasserstein GAN
Wasserstein GANWasserstein GAN
Wasserstein GAN
 
Masked Autoencoders Are Scalable Vision Learners.pptx
Masked Autoencoders Are Scalable Vision Learners.pptxMasked Autoencoders Are Scalable Vision Learners.pptx
Masked Autoencoders Are Scalable Vision Learners.pptx
 
Optimization/Gradient Descent
Optimization/Gradient DescentOptimization/Gradient Descent
Optimization/Gradient Descent
 
Self-supervised Learning Lecture Note
Self-supervised Learning Lecture NoteSelf-supervised Learning Lecture Note
Self-supervised Learning Lecture Note
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
 
Steffen Rendle, Research Scientist, Google at MLconf SF
Steffen Rendle, Research Scientist, Google at MLconf SFSteffen Rendle, Research Scientist, Google at MLconf SF
Steffen Rendle, Research Scientist, Google at MLconf SF
 
Back propagation
Back propagationBack propagation
Back propagation
 
Back propagation method
Back propagation methodBack propagation method
Back propagation method
 
Evolution of the StyleGAN family
Evolution of the StyleGAN familyEvolution of the StyleGAN family
Evolution of the StyleGAN family
 

Viewers also liked

Introduction to Convolutional Neural Networks
Introduction to Convolutional Neural NetworksIntroduction to Convolutional Neural Networks
Introduction to Convolutional Neural Networks
Hannes Hapke
 
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Jia-Bin Huang
 
Backpropagation in Convolutional Neural Network
Backpropagation in Convolutional Neural NetworkBackpropagation in Convolutional Neural Network
Backpropagation in Convolutional Neural NetworkHiroshi Kuwajima
 
AI&BigData Lab. Артем Чернодуб "Распознавание изображений методом Lazy Deep ...
AI&BigData Lab. Артем Чернодуб  "Распознавание изображений методом Lazy Deep ...AI&BigData Lab. Артем Чернодуб  "Распознавание изображений методом Lazy Deep ...
AI&BigData Lab. Артем Чернодуб "Распознавание изображений методом Lazy Deep ...
GeeksLab Odessa
 
Neuroevolution and deep learing
Neuroevolution and deep learing Neuroevolution and deep learing
Neuroevolution and deep learing
Accenture
 
Deep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - OverviewDeep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - Overview
Keunwoo Choi
 
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Madhumita Tamhane
 
Introduction to CNN
Introduction to CNNIntroduction to CNN
Introduction to CNN
Shuai Zhang
 
101: Convolutional Neural Networks
101: Convolutional Neural Networks 101: Convolutional Neural Networks
101: Convolutional Neural Networks
Mad Scientists
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
Gaurav Mittal
 
Deep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural NetworksDeep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural Networks
Christian Perone
 

Viewers also liked (11)

Introduction to Convolutional Neural Networks
Introduction to Convolutional Neural NetworksIntroduction to Convolutional Neural Networks
Introduction to Convolutional Neural Networks
 
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015Lecture 29 Convolutional Neural Networks -  Computer Vision Spring2015
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
 
Backpropagation in Convolutional Neural Network
Backpropagation in Convolutional Neural NetworkBackpropagation in Convolutional Neural Network
Backpropagation in Convolutional Neural Network
 
AI&BigData Lab. Артем Чернодуб "Распознавание изображений методом Lazy Deep ...
AI&BigData Lab. Артем Чернодуб  "Распознавание изображений методом Lazy Deep ...AI&BigData Lab. Артем Чернодуб  "Распознавание изображений методом Lazy Deep ...
AI&BigData Lab. Артем Чернодуб "Распознавание изображений методом Lazy Deep ...
 
Neuroevolution and deep learing
Neuroevolution and deep learing Neuroevolution and deep learing
Neuroevolution and deep learing
 
Deep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - OverviewDeep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - Overview
 
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
 
Introduction to CNN
Introduction to CNNIntroduction to CNN
Introduction to CNN
 
101: Convolutional Neural Networks
101: Convolutional Neural Networks 101: Convolutional Neural Networks
101: Convolutional Neural Networks
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
 
Deep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural NetworksDeep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural Networks
 

Similar to Convolution as matrix multiplication

Ch02
Ch02Ch02
Capítulo 02 considerações estatísticas
Capítulo 02   considerações estatísticasCapítulo 02   considerações estatísticas
Capítulo 02 considerações estatísticas
Jhayson Carvalho
 
Calculation template
Calculation templateCalculation template
Calculation template
Yekian Ian
 
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdfSolucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdf
DannyCoronel5
 
Solucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdfSolucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdf
franciscoantoniomonr1
 
project designa.docx
project designa.docxproject designa.docx
project designa.docx
Mahamad Jawhar
 
2d beam element with combined loading bending axial and torsion
2d beam element with combined loading bending axial and torsion2d beam element with combined loading bending axial and torsion
2d beam element with combined loading bending axial and torsion
rro7560
 
Deber 9
Deber 9Deber 9
Examen final
Examen finalExamen final
Examen final
Jcabreraes
 
Examples on total consolidation
Examples on total  consolidationExamples on total  consolidation
Examples on total consolidation
Malika khalil
 
Gaussian Elimination
Gaussian EliminationGaussian Elimination
Gaussian EliminationZunAib Ali
 
Shi20396 ch03
Shi20396 ch03Shi20396 ch03
Shi20396 ch03
Paralafakyou Mens
 
130 problemas dispositivos electronicos lopez meza brayan
130 problemas dispositivos electronicos lopez meza brayan130 problemas dispositivos electronicos lopez meza brayan
130 problemas dispositivos electronicos lopez meza brayan
brandwin marcelo lavado
 
Math 6 (Please download first to activate the different animation settings)
Math 6 (Please download first to activate the different animation  settings)Math 6 (Please download first to activate the different animation  settings)
Math 6 (Please download first to activate the different animation settings)
Eddie Abug
 
Budynas sm ch01
Budynas sm ch01Budynas sm ch01
Budynas sm ch01
Engel Villanueva
 
Perfect method for Frames
Perfect method for FramesPerfect method for Frames
Perfect method for Framesandreslahe
 
Coeficiente de correlacion lineal 5 1
Coeficiente de correlacion lineal 5 1Coeficiente de correlacion lineal 5 1
Coeficiente de correlacion lineal 5 1
Poncho Garcia
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II FinalArna Friend
 

Similar to Convolution as matrix multiplication (20)

Ch02
Ch02Ch02
Ch02
 
Capítulo 02 considerações estatísticas
Capítulo 02   considerações estatísticasCapítulo 02   considerações estatísticas
Capítulo 02 considerações estatísticas
 
Calculation template
Calculation templateCalculation template
Calculation template
 
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdfSolucionario_Diseno_en_Ingenieria_Mecani (1).pdf
Solucionario_Diseno_en_Ingenieria_Mecani (1).pdf
 
Solucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdfSolucionario_Diseno_en_Ingenieria_Mecani.pdf
Solucionario_Diseno_en_Ingenieria_Mecani.pdf
 
Ejerciciooo3
Ejerciciooo3Ejerciciooo3
Ejerciciooo3
 
project designa.docx
project designa.docxproject designa.docx
project designa.docx
 
Budynas sm ch20
Budynas sm ch20Budynas sm ch20
Budynas sm ch20
 
2d beam element with combined loading bending axial and torsion
2d beam element with combined loading bending axial and torsion2d beam element with combined loading bending axial and torsion
2d beam element with combined loading bending axial and torsion
 
Deber 9
Deber 9Deber 9
Deber 9
 
Examen final
Examen finalExamen final
Examen final
 
Examples on total consolidation
Examples on total  consolidationExamples on total  consolidation
Examples on total consolidation
 
Gaussian Elimination
Gaussian EliminationGaussian Elimination
Gaussian Elimination
 
Shi20396 ch03
Shi20396 ch03Shi20396 ch03
Shi20396 ch03
 
130 problemas dispositivos electronicos lopez meza brayan
130 problemas dispositivos electronicos lopez meza brayan130 problemas dispositivos electronicos lopez meza brayan
130 problemas dispositivos electronicos lopez meza brayan
 
Math 6 (Please download first to activate the different animation settings)
Math 6 (Please download first to activate the different animation  settings)Math 6 (Please download first to activate the different animation  settings)
Math 6 (Please download first to activate the different animation settings)
 
Budynas sm ch01
Budynas sm ch01Budynas sm ch01
Budynas sm ch01
 
Perfect method for Frames
Perfect method for FramesPerfect method for Frames
Perfect method for Frames
 
Coeficiente de correlacion lineal 5 1
Coeficiente de correlacion lineal 5 1Coeficiente de correlacion lineal 5 1
Coeficiente de correlacion lineal 5 1
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II Final
 

Recently uploaded

Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 

Recently uploaded (20)

Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 

Convolution as matrix multiplication

  • 1. Convolution as matrix multiplication • Edwin Efraín Jiménez Lepe
  • 2. 16 24 32 47 18 26 68 12 9 Input 0 1 -1 0 2 3 4 5 W1 W2 ∗ = 16 47 24 18 47 68 18 12 24 18 32 26 18 12 26 9 Im2col (input) 0 5 1 3 -1 4 0 2 x W1 W2 = 23 353 50 535 -14 354 -14 248 Rearrange 23 -14 50 -14 353 354 535 248 FeedForward Applying kernel rotation
  • 3. 16 24 32 47 18 26 68 12 9 Input 0 1 -1 0 2 3 4 5 W1 W2 ∗ = 16 47 24 18 47 68 18 12 24 18 32 26 18 12 26 9 Im2col (input) 0 5 1 3 -1 4 0 2 x W1 W2 = 23 353 50 535 -14 354 -14 248 Rearrange 24 -13 51 -13 353 354 535 248 Now with bias 1 1 1 1 1 0 FeedForward
  • 4. 16 24 32 47 18 26 68 12 9 Input 0 0 -2.94504954e-05 0 d_y ∗ = 16 47 24 18 47 68 18 12 24 18 32 26 18 12 26 9 Im2col (input) 0 0 -2e-05 6e-06 0 0 0 0 x Im2col(d_y) -1.38417328e-03 3.00583533 e-04 -2.00263369e-03 4.34886814 e-04 -5.30108917e-04 1.15117098 e-04 -3.53405945e-04 7.67447318 e-05 Rearrange -1.38417328e-03 -5.30108917e-04 -2.00263369e-03 3.53405945e-04 d_w = input * d_y The update correspond to the Rotated kernel BackPropagation d_w 0 0 6.39539432e-06 0 -1.38417328e-03 -5.30108917e-04 -2.00263369e-03 3.53405945e-04
  • 5. 0 0 -2.94504954e-05 0 d_y d_x = d_y * w (without rotation) BackPropagation 0 0 -6.39539432e-06 0 We need full convolution And keep kernel unrotated 0 0 0 0 0 0 0 0 0 -2.94504954e-05 0 0 0 0 0 0 d_y 0 0 0 0 0 0 0 0 0 6.39539432e-06 0 0 0 0 0 0 0 1 -1 0 2 3 4 5 W1 W2 ∗ 0 1 -1 0 2 3 4 5 W1 W2 ∗
  • 6. d_x = d_y * w (without rotation) BackPropagation 0 0 0 0 0 0 0 0 0 -2.94504954e-05 0 0 0 0 0 0 d_y 0 0 0 0 0 0 0 0 0 6.39539432e-06 0 0 0 0 0 0 = 0 1 -1 0 2 3 4 5 W1 W2 ∗ 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 0 -1 1 0 x 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 2 4 3 5 x T T
  • 7. d_x = d_y * w (without rotation) BackPropagation 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 0 -1 1 0 x 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 2 4 3 5 x T T = 0 0 -0.2945e-04 0 0.2945e-04 0 0 0 0 0 0.3198e-04 0.1919-04 0 0.2558-04 0.1279-04 0 0 0
  • 8. d_x = d_y * w (without rotation) BackPropagation 0 0 -0.2945e-04 0 0.2945e-04 0 0 0 0 0 0.3198e-04 0.1919-04 0 0.2558-04 0.1279-04 0 0 0 + = 0 0.3198e-04 -0.1026e-04 0 0.5503e-04 0.1279-04 0 0 0 reshape 0 0 0 0.3198e-04 0.5503e-04 0 -0.1026e-04 0.1279-04 0
  • 9. d_x = d_y * w (without rotation) BackPropagation 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 -2.94e-05 0 0 0 0 0 0 0 0 -1 1 0 x 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 6.395e-06 0 0 0 0 0 0 0 2 4 3 5 T = In fact, we can do it in just one operation 0 0.3198e-04 -0.1026e-04 0 0.5503e-04 0.1279-04 0 0 0 Notice, every channel of delta is multiplied by the correspondent filter that generates it
  • 10. A multi-channel example 16 24 32 47 18 26 68 12 9 Input 26 57 43 24 21 12 02 11 19 18 47 21 4 6 12 81 22 13 0 1 -1 0 2 3 4 5 Filter 1 Filter 2 ∗ -2 68 24 16 18 32 22 60 23 7 46 35 42 20 81 78 (3,3,3) (2,3,2,2) Output= (2,2,2) = 2171 2170 5954 2064 13042 13575 11023 6425 Applying theano convolution (which rotates Automatically the filters)
  • 11. A multi-channel example (vectorized) 16 24 32 47 18 26 68 12 9 Input 26 57 43 24 21 12 02 11 19 18 47 21 4 6 12 81 22 13 0 1 -1 0 2 3 4 5 Filter 1 Filter 2 ∗ -2 68 24 16 18 32 22 60 23 7 46 35 42 20 81 78 (3,3,3) (2,3,2,2) = 16 47 24 18 47 68 18 12 24 18 32 26 18 12 26 9 26 24 57 21 24 2 21 11 57 21 43 12 21 11 12 19 18 4 47 6 4 81 6 22 47 6 21 12 6 22 12 13 0 60 1 32 -1 22 0 18 5 35 3 7 4 46 2 23 16 78 68 20 24 81 -2 42 x T
  • 12. A multi-channel example (vectorized) 16 47 24 18 47 68 18 12 24 18 32 26 18 12 26 9 26 24 57 21 24 2 21 11 57 21 43 12 21 11 12 19 18 4 47 6 4 81 6 22 47 6 21 12 6 22 12 13 x = T 0 60 1 32 -1 22 0 18 5 35 3 7 4 46 2 23 16 78 68 20 24 81 -2 42 2171 13042 5954 11023 2170 13575 2064 6425 Channel 1 Channel 2 Rearrange 2171 2170 5954 2064 13042 13575 11023 6425
  • 13. Backpropagation .1678 .098 .002 .246 0.5 0.67 0.21 0.487 Imagine we got the next error from an up-layer And we want to propagate it to the correspondent layer (input of convolution) We need to compute d_y * w (without rotation) But is a ‘full’ convolution, so we add 1 zero padding to d_y 0 0 0 0 0 .1678 .098 0 0 .002 .246 0 0 0 0 0 0 0 0 0 0 0.5 .67 0 0 .21 .487 0 0 0 0 0
  • 14. Backpropagation d_y-1=d_y * w (without rotation) 0 0 0 0 0 .1678 .098 0 0 .002 .246 0 0 0 0 0 0 0 0 0 0 0.5 .67 0 0 .21 .487 0 0 0 0 0 im2col 0 0 0 0 .1678 .002 0 .098 .246 0 0 0 .1678 .002 0 .098 .246 0 0 .1678 .002 0 .098 .246 0 0 0 .1678 .002 0 .098 .246 0 0 0 0 0 0 0 0 .5 .21 0 .67 .487 0 0 0 .5 .21 0 .67 .487 0 0 .5 .21 0 .67 .487 0 0 0 .5 .21 0 .67 .487 0 0 0 0
  • 15. Backpropagation d_y-1=d_y * w (without rotation) 0 0 0 0 .1678 .002 0 .098 .246 0 0 0 .1678 .002 0 .098 .246 0 0 .1678 .002 0 .098 .246 0 0 0 .1678 .002 0 .098 .246 0 0 0 0 0 0 0 0 .5 .21 0 .67 .487 0 0 0 .5 .21 0 .67 .487 0 0 .5 .21 0 .67 .487 0 0 0 .5 .21 0 .67 .487 0 0 0 0 T Notice, every channel of delta is multiplied by the correspondent filter that generates it 0 -1 1 0 2 4 3 5 -2 24 68 16 18 22 32 60 23 46 7 35 42 81 20 78 x = 30 18.339 41.6848 28.7678 11.3634 37.8224 6.722 1.476 4.336 51.0322 47.6112 98.3552 64.376 44.7626 99.7084 19.61 8.981 35.284 14.642 31.212 56.622 22.528 38.992 73.295 8.766 11.693 19.962
  • 16. Backpropagation d_y-1=d_y * w (without rotation) 30 18.339 41.6848 28.7678 11.3634 37.8224 6.722 1.476 4.336 51.0322 47.6112 98.3552 64.376 44.7626 99.7084 19.61 8.981 35.284 14.642 31.212 56.622 22.528 38.992 73.295 8.766 11.693 19.962 rearrange 30 51.0322 14.642 28.7678 64.376 22.528 6.722 19.61 8.766 18.339 47.6112 31.212 11.3634 44.7626 38.992 1.476 8.981 11.693 41.6848 98.3552 56.622 37.8224 99.7084 73.295 4.336 35.284 19.962
  • 17. Backpropagation (no vectorized) d_y-1=d_y * w (without rotation) .1678 .098 .002 .246 0.5 0.67 0.21 0.487 (2,2,2) 0 1 -1 0 2 3 4 5 Filter 1 Filter 2 ∗ -2 68 24 16 18 32 22 60 23 7 46 35 42 20 81 78 (2,3,2,2) Transpose dimensions 0 and 1 .1678 .098 .002 .246 0.5 0.67 0.21 0.487 (2,2,2) 0 1 -1 0 2 3 4 5 Filter 1 Filter 2 ∗ -2 68 24 16 18 32 22 60 23 7 46 35 42 20 81 78 (3,2,2,2) Filter 3
  • 18. Backpropagation (no vectorized, full convolution) d_y-1=d_y * w (without rotation) .1678 .098 .002 .246 0.5 0.67 0.21 0.487 (2,2,2) 0 1 -1 0 2 3 4 5 Filter 1 Filter 2 ∗ -2 68 24 16 18 32 22 60 23 7 46 35 42 20 81 78 (3,2,2,2) Filter 3 = 30 51.0322 14.642 28.7678 64.376 22.528 6.722 19.61 8.766 18.339 47.6112 31.212 11.3634 44.7626 38.992 1.476 8.981 11.693 41.6848 98.3552 56.622 37.8224 99.7084 73.295 4.336 35.284 19.962
  • 19. Backpropagation d_w=input * d_y16 24 32 47 18 26 68 12 9 Input 26 57 43 24 21 12 02 11 19 18 47 21 4 6 12 81 22 13 (3,3,3) ∗ .1678 .098 .002 .246 0.5 0.67 0.21 0.487 = d_y (2,2,2) Dimensions do not match, So it is telling us that we need to Apply both filters to any cannel of the input 16 24 32 47 18 26 68 12 9 ∗ .1678 .098 .002 .246 0.5 0.67 0.21 0.487 = 9.5588 13.5952 12.7386 7.8064 42.716 49.882 55.684 33.323 26 57 43 24 21 12 02 11 19 ∗ .1678 .098 .002 .246 0.5 0.67 0.21 0.487 = 15.1628 16.7726 8.7952 9.3958 66.457 67.564 31.847 30.103 ∗ .1678 .098 .002 .246 0.5 0.67 0.21 0.487 = 9.1104 12.9086 6.8332 5.4248 44.252 44.674 33.744 21.991 18 47 21 4 6 12 81 22 13
  • 20. Backpropagation d_w=input * d_y = 33.832 43.2764 28.367 22.627 153.425 162.12 121.275 85.417 Error associated with rotated kernel, it means We need to rotate this result to update the unrotated kernel 9.5588 13.5952 12.7386 7.8064 42.716 49.882 55.684 33.323 15.1628 16.7726 8.7952 9.3958 66.457 67.564 31.847 30.103 9.1104 12.9086 6.8332 5.4248 44.252 44.674 33.744 21.991 + +
  • 21. Backpropagation vectorized d_w=input * d_y (without rotate d_y) 16 24 32 47 18 26 68 12 9 Input 26 57 43 24 21 12 02 11 19 18 47 21 4 6 12 81 22 13 (3,3,3) ∗ .1678 .098 .002 .246 0.5 0.67 0.21 0.487 = d_y (2,2,2) Dimensions do not match, So it is telling us that we need to Apply both filters to any cannel of the input 16 47 24 18 47 68 18 12 24 18 32 26 18 12 26 9 26 24 57 21 24 2 21 11 57 21 43 12 21 11 12 19 18 4 47 6 4 81 6 22 47 6 21 12 6 22 12 13 T x .1678 0.5 .002 0.21 .098 0.67 .246 0.487 .1678 0.5 .002 0.21 .098 0.67 .246 0.487 .1678 0.5 .002 0.21 .098 0.67 .246 0.487
  • 22. Backpropagation vectorized d_w=input * d_y (without rotate d_y) 16 47 24 18 47 68 18 12 24 18 32 26 18 12 26 9 26 24 57 21 24 2 21 11 57 21 43 12 21 11 12 19 18 4 47 6 4 81 6 22 47 6 21 12 6 22 12 13 T x .1678 0.5 .002 0.21 .098 0.67 .246 0.487 .1678 0.5 .002 0.21 .098 0.67 .246 0.487 .1678 0.5 .002 0.21 .098 0.67 .246 0.487 = 33.832 153.425 28.367 121.275 43.2764 162.12 22.627 85.417 33.832 43.2764 28.367 22.627 153.425 162.12 121.275 85.417 rearrange