We had to choose two hidden layers, one input layer and one output layer and we had to use the train
Updated 3 Jun 2014

View License

We had to choose two hidden layers, one input layer and one output layer and we had to use the training set of following form:

Here we use different values of learning cofficient(Ƞ) , number of neurons(n) in the hidden layer and number of steps(N) and observe the results.
N= 10, 15, 20
Ƞ= 0.1, 0.5, 0.9
N= 10, 15, 20
This was achieved by using back propogation algorithm. Number of neurons in the hidden layer were varied depending upon te requirements and in the outter layer a single neuron was implemented.
There are two inputs. One of them is the value of xi which is actually the input of the function h(x). Second one is for threshold, which is always -1. Now the weight(extended) matrix depend upon the number of neurons used in the hidden layer. Weight(extended) matrix is nx2, where n is the number of neurons and the 2nd column is for threshold vector. Random weights were initialized ranging from -4 to +4. The input multiplies with the weight and then goes through the non linear function which is given as:

After passing through this function the output of this non linear function goes to the single neuron of the output layer which gives an output. This output is passed through the similar non linear function and is compared with the desired output h(x(i)). This gives us error. By using this error the local gradient of both outer and hidden layers is calculated. By using this local gradient weight update is done for both layers. This is done for all training sets. After finishing of an Epoch average error is calculated. Epochs keep on running until Eavg (average error)<10e-4 is achieved.

Cite As

BUITEMS Quetta (2024). backprop.m (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Cardiology in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes