0% found this document useful (0 votes)
37 views2 pages

Forward Pass

This document contains the details of a feedforward and backpropagation pass for a neural network with two layers. It provides the weight matrices Theta1 and Theta2, input data X and labels Y, and shows the calculations for the forward pass, backpropagation pass, and partial derivatives to update the weights.

Uploaded by

Muneeb Butt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Forward Pass

This document contains the details of a feedforward and backpropagation pass for a neural network with two layers. It provides the weight matrices Theta1 and Theta2, input data X and labels Y, and shows the calculations for the forward pass, backpropagation pass, and partial derivatives to update the weights.

Uploaded by

Muneeb Butt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

0.5 0.3 −0.

1
Theta1 =
0.2 −0.4 −2.8

2
Theta2 = −2.5
2.5

X, Y = [2 3], [1]

X, Y = [-0.4, 0.5], [0]

Feedforward Pass
X, Y = [2 3], [1]

a1 = X, a1 = [2 3]
1
0.5 0.3 −0.1
Z2 = Theta1*X = *2
0.2 −0.4 −2.8
3

Z2= 0.5 ∗ 1 + 0.3 ∗ 2 + −0.1 ∗ 3 = 0.8


0.2 ∗ 1 + (−0.4) ∗ 2 + (−2.8) ∗ 3 −6.0

a2 = g(z2) = 𝑔 0.8 = 0.69


−9.0 0
1
a2 = 0.69
0
1
z3 = Theta2*a2 = [2 −2.5 2.5] ∗ 0.69 = [2 ∗ 1 + (−2.5) ∗ 0.69 + 2.5 ∗ 0]
0
z3 = [0.275]

a3=h=g(z3) = g([0.275])=0.57
Back-Propaga on Pass

Delta3 = h-y = 0.57-1 = -0.43

Delta2 = Theta2*Delta3 .* g’(z2)

2 2 1 1
= −2.5 ∗ (−0.43) ∗ 𝑎2(1 − 𝑎2) = −2.5 ∗ (−0.43) ∗ 0.69 ∗ 1 − 0.69
2.5 2.5 0 0

2 ∗ −0.43 1 0 2 ∗ −0.43 0
= −2.5 ∗ −0.43 ∗ 0.69 ∗ 0.31 = −2.5 ∗ −0.43 ∗ 0.21 =
2.5 ∗ −0.43 0 1 2.5 ∗ −0.43 0
−0.86 0 0
= 1.08 ∗ 0.21 = 0.227
−1.08 0 0
0
Delta2= 0.227
0

∆ = A2*delta3
1 −0.43
∆2 = ∆2 + 0.69 ∗ −0.43 = −0.3
0 0

∆1 = ∆1 + A1*Delta2 =∆1 + [1 2 3]* 0.227


0

( ) ( ) ( )
𝑥 =𝑎 *𝛿 =2 ∗ 0.227 = 0.454
( ) ( ) ( )
𝑥 =𝑎 *𝛿 =2 ∗ 0 = 0

( ) ( ) ( )
𝑥 =𝑎 *𝛿 =3∗ 0.227 = 0.681
( ) ( ) ( )
𝑥 =𝑎 *𝛿 =3∗0= 0

Theta = theta-alpha*Par al Deriva ve

You might also like