Académique Documents
Professionnel Documents
Culture Documents
AIM :
To design a neural net for a simple transfer function and train the net to get minimum error.
THEORY:
An artificial neural network is a system based on the operation of biological neural networks, in
other words, is an emulation of biological neural system. Artificial neural networks have
different architectures, which consequently requires different types of algorithms. The Artificial
Neural Network is built with a systematic step-by-step procedure to optimize a performance
criterion or to follow some implicit internal constraint, which is commonly referred to as the
learning rule.
MATHEMATICAL MODEL:
The strength of the connection between an input and a neuron is noted by the value of the
weight. Negative weight values reflect inhibitory connections, while positive values designate
excitatory connections .The next two components model the actual activity within the neuron
cell. An adder sums up all the inputs modified by their respective weights. This activity is
referred to as linear combination. Finally, an activation function controls the amplitude of the
output of the neuron. An acceptable range of output is usually between 0 and 1, or -1 and 1.
• Feed-forward neural networks: Here the data flow from input to output units is
strictly feedforward. The data processing can extend over multiple (layers of) units, but
no feedback connections are present..
• Recurrent neural networks : These contain feedback connections. Contrary to
feed-forward networks, the dynamical properties of the network are important. In some
cases, the activation values of the units undergo a relaxation process such that the neural
network will evolve to a stable state in which these activations do not change anymore.
TRAINING OF NETS
A neural network has to be configured such that the application of a set of inputs produces the
desired set of outputs. This is called training.We can categorise the learning situations in distinct
sorts. These are:
• A neural network can perform tasks that a linear program can not.
• When an element of the neural network fails, it can continue without any problem
by their parallel nature.
• A neural network learns and does not need to be reprogrammed.
• It can be implemented in any application.
• It can be implemented without any problem.
DISADVANTAGES
PROCEDURE:
• Open a model file and connect all the blocks as shown in the diagram.
• Use the arrays from the workspace and create a neural network.
CODE
net=newff(in,out,13)
y=sim(net,in)
plot(t,out)
plot(t,out,t,y)
a=in’
b=out’
nntool
plot(network1 errors)
OUTPUT:
Input array a:
>>a=in’
Columns 1 through 12
1 1 1 1 1 1 1 0 0 1 1 0
Columns 13 through 24
0 1 1 1 0 0 0 1 1 1 1 1
Columns 25 through 36
0 0 0 1 1 1 0 0 0 0 1 1
Columns 37 through 48
1 1 0 0 0 1 1 1 1 1 1 0
Columns 49 through 60
0 0 0 1 1 1 1 0 0 0 0 1
Columns 61 through 72
1 1 1 0 0 0 0 0 0 1 1 1
Columns 73 through 84
1 0 0 1 1 1 0 0 0 0 1 1
Columns 85 through 96
1 1 0 0 0 0 1 1 1 1 0 0
0 1 1 1 1 1 0 0 0 0 1 1
0 0 0 1 1 0 0 1 1 1 0 0
1 1 1 1 1 0 0 0 1 1 1 1
0 0 0 0 1 1 1 0 0 0 0 1
1 1 0 0 0 0 0 0 1 1 1 0
0 0 0 0 1 1 1 1 1 0 0 0
1 1 1 1 1 0 0 0 1 1 1 0
0 0 0 1 1 1 1 0 0 0 1 1
1 0 0 0 0 0
Output array:
>> b=out'
b=
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
Columns 22 through 28
Columns 29 through 35
Columns 36 through 42
Columns 43 through 49
Columns 50 through 56
Columns 57 through 63
Columns 64 through 70
Columns 71 through 77
Columns 78 through 84
0.5412 0.5412 0.4897 0.4431 0.4010 0.4010 0.4010
Columns 85 through 91
Columns 92 through 98
0.4935 0.4465
closed loop response :
0.8
0.7
0.6
0.5
output
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
time(sec)
neural net response :
0.8
0.7
0.6
y(neural net output)
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
time(sec)
0.3
0.2
0.1
0
network error
-0.1
-0.2
-0.3
-0.4
-0.5
0 20 40 60 80 100 120
time(sec)
INFERENCE:
The neural net is trained for many epochs with the objective that the error should be minimum.
(minimum mean square error).
RESULT:
Thus neural net is designed for a simple transfer function system and is trained to get minimum
error.