Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Essay

Back propagation for Neural Networks (ANNs)

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
25-11-2024
Written in
2023/2024

This essay describes how to perform the back propagation algorithm step-by-step for a single two-layer neural networks (ANNs) with sigmoid activation function. Describe how to derive the update equations for the weights and biases.

Show more Read less
Institution
Course

Content preview

Perform the backpropagation algorithm step-by-step for a simple two-layer neural
network with sigmoid activation function. Derive the update equations for weights and
biases.
Backpropagation is a commonly used technique for training neural network. Compute
gradients layer by layer (reverse order).




The Neural Network will be built on three layers: Input layer with two inputs neurons, one
hidden layer with two neurons and output layer with a single neuron.




Gradient descent is an iterative optimization algorithm for finding the minimum of a
function; in our case we want to minimize the error function. To find a local minimum of a
function using gradient descent, one takes steps proportional to the negative of the gradient of
the function at the current point.
Forward Pass: Given input data X and target output Y, calculate the predicted
output Ŷ using the current weights and biases. Forward Pass: Input: X = [𝑥1, … , 𝑥𝑑 ]. Hidden
layer: Net input to neuron j: z𝑗 ℎ = Σ(𝑤𝑗𝑘 × 𝑥𝑘 ) + 𝑏𝑗 ℎ . Output of neuron j: 𝑎𝑗 ℎ = σ(z𝑗 ℎ ).
Output layer: Net input to output neuron: z𝑜 = Σ(𝑤𝑗𝑜 * 𝑎𝑗 ℎ ) + 𝑏𝑜 . Output (prediction): y =
σ(z𝑜 ).
Then apply the sigmoid activation function to the hidden layer and output layer. The most
1
commonly used activation functions: Sigmoid: σ(z) = 1+𝑒𝑥𝑝(−𝑧)

, Calculate Error: to find out how our network performed, compute the error between the
predicted output Ŷ and the actual output Y using the mean squared error as follows: error=0
1
if prediction=actual. Error = (𝑃𝑟𝑒𝑑𝑖𝑐𝑡𝑖𝑜𝑛 − 𝐴𝑐𝑡𝑢𝑎𝑙)2 .
2


Reducing error: the main goal of the training is to reduce the error or the difference
between prediction and actual output. Since actual output is constant, “not changing”, the
only way to reduce the error is to change prediction value. This can be done by
decomposing prediction into its basic elements we can find that weights are the variable
elements affecting prediction value. In other words, in order to change prediction value, we
need to change weights values.

Prediction= ℎ1 𝑤5 + ℎ2 𝑤6
= (𝑖1 𝑤1 + 𝑖2 𝑤2 )𝑤5 + (𝑖1 𝑤3 + 𝑖2 𝑤4 )𝑤6
To change or update the weights value so that the error is reduced, back-propagation is
used.
Backward Pass: Compute the gradient of the loss function with respect to the output layer
weights and biases. Backpropagation, short for “backward propagation of errors”, is a
mechanism used to update the weights using gradient descent. It calculates the gradient of the
error function with respect to the neural network’s weights. The calculation proceeds
backwards through the network. Neural network training is about finding weights that
minimize prediction error. We usually start our training with a set of randomly generated
weights. Then, backpropagation is used to update the weights in an attempt to correctly map
arbitrary inputs to outputs. Let the initial weights be: 𝑤1 , … , 𝑤6 .
𝜕 𝑒𝑟𝑟𝑜𝑟
𝑊𝑥 =𝑊𝑥 − 𝛼
𝜕 𝑊𝑥

New Weight = Old Weight – learning rate * Gradient

Written for

Course

Document information

Uploaded on
November 25, 2024
Number of pages
5
Written in
2023/2024
Type
ESSAY
Professor(s)
Unknown
Grade
A+

Subjects

$14.86
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
phephymalinga58

Get to know the seller

Seller avatar
phephymalinga58 University of Swaziland
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 year
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions