SlideShare a Scribd company logo
1 of 30
Download to read offline
Backpropagation Derivation in Convolutional Neural
Networks
Punnoose A K
punnoose07@gmail.com
August 6, 2020
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 1 / 30
Contents
1 A simple CNN
2 Differential for various functions
3 Update equations for various CNN parameters
4 General Order of Update
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 2 / 30
A simple 2 Layered ,Depth 1 CNN
X
K J1
f
C1
S1
G J2
f
C2
S2
A
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 3 / 30
Notations
1 X : Input feature. Assuming only 1 feature stream
2 K : Kernel. Depth 1
3 f : Rectified Linear Unit
4 C1 : First Convolution Output before ReLU
5 J1 : First Convolution Output after ReLU
6 S1 : Max Pooled Output, first layer
7 G : Kernel at second layer
8 C2 :Second Convolution Output before ReLU
9 J2 : Second Convolution Output after ReLU
10 S2 : Max Pooled Output, second layer
11 A : Flattened S2. I is the input size. A1 to AI
12 uij : weight between input and hidden layer
13 vjk: weight between hidden and output layer
14 yj : net input to hidden layer node j
15 zj : net input to output layer node j
16 bj : output of hidden layer node j
17 cj : output of output layer node j
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 4 / 30
What is to be learned here?
1 uij for 1 ≤ i ≤ I, 1 ≤ j ≤ H
2 vjk for 1 ≤ j ≤ H, 1 ≤ k ≤ O
3 Kernel G
4 Kernel K
Ignore the bias for time being
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 5 / 30
CNN Operations
1 C1=relu(Convolution(X,K))
2 S1=MaxPooling(C1)
3 C2=relu(Convolution(S1,G))
4 S2=MaxPooling(C2)
5 A=flatten(S2)
6 Feed A as the input to the fully connected network
7 sigmoid function at hidden layer
8 softmax function at output layer
9 Cross entropy as the loss function
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 6 / 30
Differential of Sigmoid Function
Let f (x) =
1
1 + e−x
f (x) =
e−x
(1 + e−x )2
=
1
1 + e−x
e−x
1 + e−x
=
1
1 + e−x
(1 −
1
1 + e−x
)
=f (x)(1 − f (x))
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 7 / 30
Differential of Softmax Function
Softmax function is defined as
fi = f (i; c1, c2...cO) =
eci
i eci
For finding the differential, there are 2 cases.
i.e, dfi
dck
where i = k
and dfi
dck
, where i = k.
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 8 / 30
Differential of Softmax Function
For sake of simplicity consider 2 class output, i.e, O = 2.
f1 = f (1; c1, c2) =
ec1
ec1 + ec2
Case: i = k
df1
dc1
=
(ec1 + ec2 )ec1 − ec1 ec1
(ec1 + ec2 )2
=
(ec1 + ec2 )ec1
(ec1 + ec2 )2
−
ec1 ec1
(ec1 + ec2 )2
=
ec1
(ec1 + ec2 )
−
ec1
(ec1 + ec2 )
2
=
ec1
(ec1 + ec2 )
1 −
ec1
(ec1 + ec2 )
=f1(1 − f1)
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 9 / 30
Differential of Softmax Function
Case: i = k
df1
dc2
= −
ec1 ec2
(ec1 + es2 )2
= −
ec1
(ec1 + es2 )
ec2
(ec1 + es2 )
= − f1f2
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 10 / 30
Differential of Softmax Function
Generalizing,
dfi
dck
=
fi (1 − fi ) i = k
−fi fk i = k
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 11 / 30
Differential of Cross Entropy Loss
Cross entropy loss between the output vector y and the target vector t of
size O is given by
L(y, t) = −
O
i
yi log(ti )
dL
dyi
= −
yi
ti
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 12 / 30
Differential of Rectified Linear Unit (ReLU)
ReLU is defined as
f (x) =max(0, x)
df
dx
=
1 x > 0
0 otherwise
In practise leaky ReLU is used, which is defined as
f (x) =max(c0, x)
df
dx
=
1 x > 0
c otherwise
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 13 / 30
Differential of Max Pooling
f (10, 20, 30, 40) = 40
Now if we increase 10 to 10.1, still f (10.1, 20, 30, 40) = 40
If we increase 30 to 30.1, still f (10.1, 20, 30, 40) = 40
Now if we increase 40 to 40.1, f (10.1, 20, 30, 40) = 40.1
if we increase 40 to 50, f (10.1, 20, 30, 50) = 50
The definition of differential is f (x) = limh→0
f (x+h)−f (x)
h
For the above function, the output changes linearly with the input(max).
So f (a, b, c, d) = 1
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 14 / 30
Backpropagation at Hidden to Output Layer
Input: X
Output: c
Target : t
z c
The output layer is divided into 2 sublayers shown in green and red. z is
the weighted sum and is passed to all the output nodes. The layer in red
actually performs the softmax operation and the softmax output is c.
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 15 / 30
Derivation
dL
dvjk
=
dL
dzk
dzk
dvjk
dL
dzk
=
O
o=1
dL
dco
dco
dzk
=
dL
dck
dck
dzk
+
o=k
dL
dco
dco
dzk
= −
tk
ck
ck(1 − ck) +
o=k
−to
co
(−cock)
= − tk(1 − ck) +
o=k
tock
= − tk + tkck +
o=k
tock
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 16 / 30
Derivation Continued
= −tk +
o=k
tock + tkck
= −tk +
o
tock
= −tk + ck
o
to
= −tk + ck1
dL
dzk
= ck − tk
dzk
dvjk
=bj
dL
dvjk
=(ck − tk)bj
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 17 / 30
Backpropagation at Input to Hidden Layer
dL
duij
=
k=O
k
dL
dzk
dzk
dbj
dbj
dyj
dyj
duij
=
dbj
dyj
dyj
duij
k
dL
dzk
dzk
dbj
= bj (1 − bj )xi
k
(ck − tk)vjk
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 18 / 30
Backpropagation for the kernels
X
K J1
f
C1
S1
G J2
f
C2
S2
A
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 19 / 30
Backpropagation for kernel G
We need to find dL
dG and dL
dK
dL
dG
=
dL
dA
dA
dS2
dS2
dC2
dC2
dJ2
dJ2
dG
As A = S2 flattened,
dL
dG
=
dL
dS2
dS2
dC2
dC2
dJ2
dJ2
dG
S2 is a max pooled version of C2. Operation wise, it is effectively selecting
the max value out of a set of numbers. Change in non max value in the
input set does not affect the output. A small change in max value value in
the input set affect linearly in the output. So it can be said that maximum
value out of a set, is locally linear. So dS2
dC2
= 1.
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 20 / 30
Backpropagation for kernel G
dL
dG
=
dL
dS2
dC2
dJ2
dJ2
dG
=
dL
dJ2
dJ2
dG
dL
dS2
is dL
dA written in square form.
dL
dAi
=
j k
dL
dzk
dzk
dbj
dbj
dyj
dyj
dAi
=
j k
(ck − tk)vjkbj (1 − bj )uij
dL
dA
=





dL
dA1
dL
dA2
...
dL
dAI





Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 21 / 30
Backpropagation for kernel G
dL
dS2
is dL
dA written in square form.
dL
dS2
=


dL
dA1
. .
. . .
. . dL
dAI


dC2
dJ2
=
1 x > 0
c otherwise
dL
dG
=
dL
dJ2
dJ2
dG
=conv(
dL
dJ2
, S1)
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 22 / 30
Backpropagation for the kernels
X
K J1
f
C1
S1
G J2
f
C2
S2
A
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 23 / 30
Backpropagation for kernel K
dL
dK
= conv(X,
dL
dJ1
)
We need to find dL
dJ1
.
dL
dJ1
=
dL
dS1
dS1
dC1
dC1
dJ1
dC1
dJ1
=
1 x > 0
c otherwise
dS1
dC1
=1
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 24 / 30
Backpropagation for kernel K
dL
dS1
=
dJ2
dG
Define G =1800
rotated G
Then,
dL
dS1
=fullconv(G ,
dL
dJ2
)
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 25 / 30
Full convolution explained
G11G12
G21G22 1800 rotate to
G22G21
G12G11
The convolution output is given as J2 =
J211 J212
J221 J222
The input matrix can be written as S1=
S131 S132 S133
S121 S122 S123
S111 S112 S113
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 26 / 30
Full convolution continued
where,
S111 =G11
dL
dJ211
S112 =G12
dL
dJ211
+ G11
dL
dJ212
S113 =G12
dL
dJ212
S121 =G21
dL
dJ211
+ G11
dL
dJ221
S122 =G22
dL
dJ211
+ G21
dL
dJ212
+ G12
dL
dJ221
+ G11
dL
dJ222
S123 =G22
dL
dJ212
+ G12
dL
dJ222
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 27 / 30
Full convolution continued
S131 =G21
dL
dJ221
S132 =G22
dL
dJ221
+ G21
dL
dJ222
S133 =G22
dL
dJ222
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 28 / 30
Order of update
1 Update hidden to output weights
2 Update input to hidden weights
3 Update kernel G
4 Update kernel K
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 29 / 30
Queries??
Connect me at punnoose07@gmail.com
Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 30 / 30

More Related Content

What's hot

Neural Art (English Version)
Neural Art (English Version)Neural Art (English Version)
Neural Art (English Version)Mark Chang
 
Vector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot NavigationVector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot NavigationJanindu Arukgoda
 
GPU Accelerated Domain Decomposition
GPU Accelerated Domain DecompositionGPU Accelerated Domain Decomposition
GPU Accelerated Domain DecompositionRichard Southern
 
Deep Learning & Tensor flow: An Intro
Deep Learning & Tensor flow: An IntroDeep Learning & Tensor flow: An Intro
Deep Learning & Tensor flow: An IntroSiby Jose Plathottam
 
Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...
Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...
Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...Simplilearn
 
Fast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeFast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeRakuten Group, Inc.
 
Lecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhsLecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhsStéphane Canu
 
Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!David Evans
 
ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...
ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...
ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...Deepak Malani
 
TensorFlow Study Part I
TensorFlow Study Part ITensorFlow Study Part I
TensorFlow Study Part ITe-Yen Liu
 
Pixel RNN to Pixel CNN++
Pixel RNN to Pixel CNN++Pixel RNN to Pixel CNN++
Pixel RNN to Pixel CNN++Dongheon Lee
 
Fast Identification of Heavy Hitters by Cached and Packed Group Testing
Fast Identification of Heavy Hitters by Cached and Packed Group TestingFast Identification of Heavy Hitters by Cached and Packed Group Testing
Fast Identification of Heavy Hitters by Cached and Packed Group TestingRakuten Group, Inc.
 
Lecture 3 image sampling and quantization
Lecture 3 image sampling and quantizationLecture 3 image sampling and quantization
Lecture 3 image sampling and quantizationVARUN KUMAR
 
On the Impossibility of Batch Update for Cryptographic Accumulators
On the Impossibility of Batch Update for Cryptographic AccumulatorsOn the Impossibility of Batch Update for Cryptographic Accumulators
On the Impossibility of Batch Update for Cryptographic AccumulatorsPhilippe Camacho, Ph.D.
 
Quantitative Propagation of Chaos for SGD in Wide Neural Networks
Quantitative Propagation of Chaos for SGD in Wide Neural NetworksQuantitative Propagation of Chaos for SGD in Wide Neural Networks
Quantitative Propagation of Chaos for SGD in Wide Neural NetworksValentin De Bortoli
 
Kernels in convolution
Kernels in convolutionKernels in convolution
Kernels in convolutionRevanth Kumar
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.UA Mobile
 

What's hot (20)

Neural Art (English Version)
Neural Art (English Version)Neural Art (English Version)
Neural Art (English Version)
 
Vector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot NavigationVector Distance Transform Maps for Autonomous Mobile Robot Navigation
Vector Distance Transform Maps for Autonomous Mobile Robot Navigation
 
GPU Accelerated Domain Decomposition
GPU Accelerated Domain DecompositionGPU Accelerated Domain Decomposition
GPU Accelerated Domain Decomposition
 
Deep Learning & Tensor flow: An Intro
Deep Learning & Tensor flow: An IntroDeep Learning & Tensor flow: An Intro
Deep Learning & Tensor flow: An Intro
 
Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...
Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...
Backpropagation And Gradient Descent In Neural Networks | Neural Network Tuto...
 
Fast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in PracticeFast Wavelet Tree Construction in Practice
Fast Wavelet Tree Construction in Practice
 
Lecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhsLecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhs
 
Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!
 
ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...
ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...
ILP Based Approach for Input Vector Controlled (IVC) Toggle Maximization in C...
 
TensorFlow Study Part I
TensorFlow Study Part ITensorFlow Study Part I
TensorFlow Study Part I
 
Pixel RNN to Pixel CNN++
Pixel RNN to Pixel CNN++Pixel RNN to Pixel CNN++
Pixel RNN to Pixel CNN++
 
A Short Review of the NTRU Cryptosystem
A Short Review of the NTRU CryptosystemA Short Review of the NTRU Cryptosystem
A Short Review of the NTRU Cryptosystem
 
Fast Identification of Heavy Hitters by Cached and Packed Group Testing
Fast Identification of Heavy Hitters by Cached and Packed Group TestingFast Identification of Heavy Hitters by Cached and Packed Group Testing
Fast Identification of Heavy Hitters by Cached and Packed Group Testing
 
2010 mainz
2010 mainz2010 mainz
2010 mainz
 
Lecture 3 image sampling and quantization
Lecture 3 image sampling and quantizationLecture 3 image sampling and quantization
Lecture 3 image sampling and quantization
 
On the Impossibility of Batch Update for Cryptographic Accumulators
On the Impossibility of Batch Update for Cryptographic AccumulatorsOn the Impossibility of Batch Update for Cryptographic Accumulators
On the Impossibility of Batch Update for Cryptographic Accumulators
 
Quantitative Propagation of Chaos for SGD in Wide Neural Networks
Quantitative Propagation of Chaos for SGD in Wide Neural NetworksQuantitative Propagation of Chaos for SGD in Wide Neural Networks
Quantitative Propagation of Chaos for SGD in Wide Neural Networks
 
Kernels in convolution
Kernels in convolutionKernels in convolution
Kernels in convolution
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 

Similar to Convolutional neural network backpropagation derivation

Cnn backpropagation derivation
Cnn backpropagation derivationCnn backpropagation derivation
Cnn backpropagation derivationPunnoose A.K
 
The reversible residual network
The reversible residual networkThe reversible residual network
The reversible residual networkThyrixYang1
 
A non-stiff boundary integral method for internal waves
A non-stiff boundary integral method for internal wavesA non-stiff boundary integral method for internal waves
A non-stiff boundary integral method for internal wavesAlex (Oleksiy) Varfolomiyev
 
Appendix of heterogeneous cellular network user distribution model
Appendix of heterogeneous cellular network user distribution modelAppendix of heterogeneous cellular network user distribution model
Appendix of heterogeneous cellular network user distribution modelCora Li
 
Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...
Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...
Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...Patrick Diehl
 
State equations model based on modulo 2 arithmetic and its applciation on rec...
State equations model based on modulo 2 arithmetic and its applciation on rec...State equations model based on modulo 2 arithmetic and its applciation on rec...
State equations model based on modulo 2 arithmetic and its applciation on rec...Anax Fotopoulos
 
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...Anax_Fotopoulos
 
Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDing Li
 
Non-exhaustive, Overlapping K-means
Non-exhaustive, Overlapping K-meansNon-exhaustive, Overlapping K-means
Non-exhaustive, Overlapping K-meansDavid Gleich
 
Forward secure asynchronous messaging from puncturable encryption
Forward secure asynchronous messaging from puncturable encryptionForward secure asynchronous messaging from puncturable encryption
Forward secure asynchronous messaging from puncturable encryptionNational Chengchi University
 
Energy Disaggregation with Discriminative Sparse Coding
Energy Disaggregation with Discriminative Sparse CodingEnergy Disaggregation with Discriminative Sparse Coding
Energy Disaggregation with Discriminative Sparse CodingMenghengXue
 
energy disaggregation with sparse coding
energy disaggregation with sparse coding energy disaggregation with sparse coding
energy disaggregation with sparse coding MenghengXue
 
Nucleon TMD Contractions in Lattice QCD using QUDA
Nucleon TMD Contractions in Lattice QCD using QUDANucleon TMD Contractions in Lattice QCD using QUDA
Nucleon TMD Contractions in Lattice QCD using QUDAChristos Kallidonis
 
論文紹介:Towards Robust Adaptive Object Detection Under Noisy Annotations
論文紹介:Towards Robust Adaptive Object Detection Under Noisy Annotations論文紹介:Towards Robust Adaptive Object Detection Under Noisy Annotations
論文紹介:Towards Robust Adaptive Object Detection Under Noisy AnnotationsToru Tamaki
 
Magical float repr
Magical float reprMagical float repr
Magical float reprdickinsm
 

Similar to Convolutional neural network backpropagation derivation (20)

Cnn backpropagation derivation
Cnn backpropagation derivationCnn backpropagation derivation
Cnn backpropagation derivation
 
The reversible residual network
The reversible residual networkThe reversible residual network
The reversible residual network
 
Backpropagation for Deep Learning
Backpropagation for Deep LearningBackpropagation for Deep Learning
Backpropagation for Deep Learning
 
A non-stiff boundary integral method for internal waves
A non-stiff boundary integral method for internal wavesA non-stiff boundary integral method for internal waves
A non-stiff boundary integral method for internal waves
 
Appendix of heterogeneous cellular network user distribution model
Appendix of heterogeneous cellular network user distribution modelAppendix of heterogeneous cellular network user distribution model
Appendix of heterogeneous cellular network user distribution model
 
Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...
Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...
Quasistatic Fracture using Nonliner-Nonlocal Elastostatics with an Analytic T...
 
Gate-Cs 2010
Gate-Cs 2010Gate-Cs 2010
Gate-Cs 2010
 
State equations model based on modulo 2 arithmetic and its applciation on rec...
State equations model based on modulo 2 arithmetic and its applciation on rec...State equations model based on modulo 2 arithmetic and its applciation on rec...
State equations model based on modulo 2 arithmetic and its applciation on rec...
 
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...
State Equations Model Based On Modulo 2 Arithmetic And Its Applciation On Rec...
 
2017 a
2017 a2017 a
2017 a
 
Backpropagation for Neural Networks
Backpropagation for Neural NetworksBackpropagation for Neural Networks
Backpropagation for Neural Networks
 
Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural network
 
Non-exhaustive, Overlapping K-means
Non-exhaustive, Overlapping K-meansNon-exhaustive, Overlapping K-means
Non-exhaustive, Overlapping K-means
 
Forward secure asynchronous messaging from puncturable encryption
Forward secure asynchronous messaging from puncturable encryptionForward secure asynchronous messaging from puncturable encryption
Forward secure asynchronous messaging from puncturable encryption
 
Energy Disaggregation with Discriminative Sparse Coding
Energy Disaggregation with Discriminative Sparse CodingEnergy Disaggregation with Discriminative Sparse Coding
Energy Disaggregation with Discriminative Sparse Coding
 
energy disaggregation with sparse coding
energy disaggregation with sparse coding energy disaggregation with sparse coding
energy disaggregation with sparse coding
 
Nucleon TMD Contractions in Lattice QCD using QUDA
Nucleon TMD Contractions in Lattice QCD using QUDANucleon TMD Contractions in Lattice QCD using QUDA
Nucleon TMD Contractions in Lattice QCD using QUDA
 
Gate-Cs 2006
Gate-Cs 2006Gate-Cs 2006
Gate-Cs 2006
 
論文紹介:Towards Robust Adaptive Object Detection Under Noisy Annotations
論文紹介:Towards Robust Adaptive Object Detection Under Noisy Annotations論文紹介:Towards Robust Adaptive Object Detection Under Noisy Annotations
論文紹介:Towards Robust Adaptive Object Detection Under Noisy Annotations
 
Magical float repr
Magical float reprMagical float repr
Magical float repr
 

Recently uploaded

Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesBoston Institute of Analytics
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Klinik kandungan
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token PredictionNABLAS株式会社
 
Introduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptxIntroduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptxAniqa Zai
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxronsairoathenadugay
 
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime GiridihGiridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridihmeghakumariji156
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...HyderabadDolls
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubaikojalkojal131
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...SOFTTECHHUB
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...gajnagarg
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...HyderabadDolls
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...HyderabadDolls
 
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...HyderabadDolls
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 

Recently uploaded (20)

Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction
 
Introduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptxIntroduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptx
 
Call Girls in G.T.B. Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in G.T.B. Nagar  (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in G.T.B. Nagar  (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in G.T.B. Nagar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
 
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime GiridihGiridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
Belur $ Female Escorts Service in Kolkata (Adult Only) 8005736733 Escort Serv...
 
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
Kalyani ? Call Girl in Kolkata | Service-oriented sexy call girls 8005736733 ...
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 

Convolutional neural network backpropagation derivation

  • 1. Backpropagation Derivation in Convolutional Neural Networks Punnoose A K punnoose07@gmail.com August 6, 2020 Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 1 / 30
  • 2. Contents 1 A simple CNN 2 Differential for various functions 3 Update equations for various CNN parameters 4 General Order of Update Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 2 / 30
  • 3. A simple 2 Layered ,Depth 1 CNN X K J1 f C1 S1 G J2 f C2 S2 A Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 3 / 30
  • 4. Notations 1 X : Input feature. Assuming only 1 feature stream 2 K : Kernel. Depth 1 3 f : Rectified Linear Unit 4 C1 : First Convolution Output before ReLU 5 J1 : First Convolution Output after ReLU 6 S1 : Max Pooled Output, first layer 7 G : Kernel at second layer 8 C2 :Second Convolution Output before ReLU 9 J2 : Second Convolution Output after ReLU 10 S2 : Max Pooled Output, second layer 11 A : Flattened S2. I is the input size. A1 to AI 12 uij : weight between input and hidden layer 13 vjk: weight between hidden and output layer 14 yj : net input to hidden layer node j 15 zj : net input to output layer node j 16 bj : output of hidden layer node j 17 cj : output of output layer node j Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 4 / 30
  • 5. What is to be learned here? 1 uij for 1 ≤ i ≤ I, 1 ≤ j ≤ H 2 vjk for 1 ≤ j ≤ H, 1 ≤ k ≤ O 3 Kernel G 4 Kernel K Ignore the bias for time being Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 5 / 30
  • 6. CNN Operations 1 C1=relu(Convolution(X,K)) 2 S1=MaxPooling(C1) 3 C2=relu(Convolution(S1,G)) 4 S2=MaxPooling(C2) 5 A=flatten(S2) 6 Feed A as the input to the fully connected network 7 sigmoid function at hidden layer 8 softmax function at output layer 9 Cross entropy as the loss function Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 6 / 30
  • 7. Differential of Sigmoid Function Let f (x) = 1 1 + e−x f (x) = e−x (1 + e−x )2 = 1 1 + e−x e−x 1 + e−x = 1 1 + e−x (1 − 1 1 + e−x ) =f (x)(1 − f (x)) Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 7 / 30
  • 8. Differential of Softmax Function Softmax function is defined as fi = f (i; c1, c2...cO) = eci i eci For finding the differential, there are 2 cases. i.e, dfi dck where i = k and dfi dck , where i = k. Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 8 / 30
  • 9. Differential of Softmax Function For sake of simplicity consider 2 class output, i.e, O = 2. f1 = f (1; c1, c2) = ec1 ec1 + ec2 Case: i = k df1 dc1 = (ec1 + ec2 )ec1 − ec1 ec1 (ec1 + ec2 )2 = (ec1 + ec2 )ec1 (ec1 + ec2 )2 − ec1 ec1 (ec1 + ec2 )2 = ec1 (ec1 + ec2 ) − ec1 (ec1 + ec2 ) 2 = ec1 (ec1 + ec2 ) 1 − ec1 (ec1 + ec2 ) =f1(1 − f1) Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural Networks August 6, 2020 9 / 30
  • 10. Differential of Softmax Function Case: i = k df1 dc2 = − ec1 ec2 (ec1 + es2 )2 = − ec1 (ec1 + es2 ) ec2 (ec1 + es2 ) = − f1f2 Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 10 / 30
  • 11. Differential of Softmax Function Generalizing, dfi dck = fi (1 − fi ) i = k −fi fk i = k Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 11 / 30
  • 12. Differential of Cross Entropy Loss Cross entropy loss between the output vector y and the target vector t of size O is given by L(y, t) = − O i yi log(ti ) dL dyi = − yi ti Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 12 / 30
  • 13. Differential of Rectified Linear Unit (ReLU) ReLU is defined as f (x) =max(0, x) df dx = 1 x > 0 0 otherwise In practise leaky ReLU is used, which is defined as f (x) =max(c0, x) df dx = 1 x > 0 c otherwise Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 13 / 30
  • 14. Differential of Max Pooling f (10, 20, 30, 40) = 40 Now if we increase 10 to 10.1, still f (10.1, 20, 30, 40) = 40 If we increase 30 to 30.1, still f (10.1, 20, 30, 40) = 40 Now if we increase 40 to 40.1, f (10.1, 20, 30, 40) = 40.1 if we increase 40 to 50, f (10.1, 20, 30, 50) = 50 The definition of differential is f (x) = limh→0 f (x+h)−f (x) h For the above function, the output changes linearly with the input(max). So f (a, b, c, d) = 1 Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 14 / 30
  • 15. Backpropagation at Hidden to Output Layer Input: X Output: c Target : t z c The output layer is divided into 2 sublayers shown in green and red. z is the weighted sum and is passed to all the output nodes. The layer in red actually performs the softmax operation and the softmax output is c. Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 15 / 30
  • 16. Derivation dL dvjk = dL dzk dzk dvjk dL dzk = O o=1 dL dco dco dzk = dL dck dck dzk + o=k dL dco dco dzk = − tk ck ck(1 − ck) + o=k −to co (−cock) = − tk(1 − ck) + o=k tock = − tk + tkck + o=k tock Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 16 / 30
  • 17. Derivation Continued = −tk + o=k tock + tkck = −tk + o tock = −tk + ck o to = −tk + ck1 dL dzk = ck − tk dzk dvjk =bj dL dvjk =(ck − tk)bj Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 17 / 30
  • 18. Backpropagation at Input to Hidden Layer dL duij = k=O k dL dzk dzk dbj dbj dyj dyj duij = dbj dyj dyj duij k dL dzk dzk dbj = bj (1 − bj )xi k (ck − tk)vjk Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 18 / 30
  • 19. Backpropagation for the kernels X K J1 f C1 S1 G J2 f C2 S2 A Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 19 / 30
  • 20. Backpropagation for kernel G We need to find dL dG and dL dK dL dG = dL dA dA dS2 dS2 dC2 dC2 dJ2 dJ2 dG As A = S2 flattened, dL dG = dL dS2 dS2 dC2 dC2 dJ2 dJ2 dG S2 is a max pooled version of C2. Operation wise, it is effectively selecting the max value out of a set of numbers. Change in non max value in the input set does not affect the output. A small change in max value value in the input set affect linearly in the output. So it can be said that maximum value out of a set, is locally linear. So dS2 dC2 = 1. Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 20 / 30
  • 21. Backpropagation for kernel G dL dG = dL dS2 dC2 dJ2 dJ2 dG = dL dJ2 dJ2 dG dL dS2 is dL dA written in square form. dL dAi = j k dL dzk dzk dbj dbj dyj dyj dAi = j k (ck − tk)vjkbj (1 − bj )uij dL dA =      dL dA1 dL dA2 ... dL dAI      Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 21 / 30
  • 22. Backpropagation for kernel G dL dS2 is dL dA written in square form. dL dS2 =   dL dA1 . . . . . . . dL dAI   dC2 dJ2 = 1 x > 0 c otherwise dL dG = dL dJ2 dJ2 dG =conv( dL dJ2 , S1) Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 22 / 30
  • 23. Backpropagation for the kernels X K J1 f C1 S1 G J2 f C2 S2 A Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 23 / 30
  • 24. Backpropagation for kernel K dL dK = conv(X, dL dJ1 ) We need to find dL dJ1 . dL dJ1 = dL dS1 dS1 dC1 dC1 dJ1 dC1 dJ1 = 1 x > 0 c otherwise dS1 dC1 =1 Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 24 / 30
  • 25. Backpropagation for kernel K dL dS1 = dJ2 dG Define G =1800 rotated G Then, dL dS1 =fullconv(G , dL dJ2 ) Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 25 / 30
  • 26. Full convolution explained G11G12 G21G22 1800 rotate to G22G21 G12G11 The convolution output is given as J2 = J211 J212 J221 J222 The input matrix can be written as S1= S131 S132 S133 S121 S122 S123 S111 S112 S113 Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 26 / 30
  • 27. Full convolution continued where, S111 =G11 dL dJ211 S112 =G12 dL dJ211 + G11 dL dJ212 S113 =G12 dL dJ212 S121 =G21 dL dJ211 + G11 dL dJ221 S122 =G22 dL dJ211 + G21 dL dJ212 + G12 dL dJ221 + G11 dL dJ222 S123 =G22 dL dJ212 + G12 dL dJ222 Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 27 / 30
  • 28. Full convolution continued S131 =G21 dL dJ221 S132 =G22 dL dJ221 + G21 dL dJ222 S133 =G22 dL dJ222 Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 28 / 30
  • 29. Order of update 1 Update hidden to output weights 2 Update input to hidden weights 3 Update kernel G 4 Update kernel K Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 29 / 30
  • 30. Queries?? Connect me at punnoose07@gmail.com Punnoose A K (punnoose07@gmail.com) Backpropagation Derivation in Convolutional Neural NetworksAugust 6, 2020 30 / 30