Professional Documents
Culture Documents
toolbox in Matlab
Entrance of matlab
>>
>> info
contacting the company
eg. Technique support, bugs.
>> ver
version of matlab and its toolboxes
licence number
>> whatsnew
whats new of the version
...
/opt1/matlab-5.3.1/toolbox/nnet/nnet/sumsqr.m
Plotting graph
Visualisation of the data and result.
Most important when handing in the report.
plot : plot the vector in 2D or 3D
x = [2 4 6 8];
plot(x,power(y,2));
Implementation of Neural
Network using NN Toolbox
Version 3.0.1
Loading data
Matrix manipulation
for all
Start for 1
stockname = data(:,1);
1
2
training = data([1:100],:)
a=[1;2]; a*a => [1,2;2,4];
1
4
4
16
2
4
-1
-1
-1
-1
neuron 1
1
1
Number of inputs
1 Max
decided by PR
1
TF2: logsig
TF1: logsig
Network Initialisation
net.layers{1}.initFcn = 'initwb';
net.inputWeights{1,1}.initFcn = 'rands';
net.biases{1,1}.initFcn = 'rands';
net.biases{2,1}.initFcn = 'rands';
Network Training
variable net;
We can reset the variable inside.
net.trainParam.epochs =1000;
net.trainParam.goal =0.01;
net.trainParam.lr =0.001;
net.trainParam.show =1;
net.trainParam.time =1000;
Network Training(contd)
-0.5
-1
0.5
-0.5
TRAIN(NET,P,T,Pi,Ai) takes,
NET - Network.
Training
P - Network inputs.
pattern 1
1
0.5
1
-1
-0.5 1
-1
0.5
0.5 1
-0.5 -1
>> p = [-0.5 1 -0.5 1; -1 0.5 -1 0.5; 0.5 1 0.5 1; -0.5 -1 -0.5 -1];
For
neuron 1
Network Training(contd)
NET - Network.
P - Network inputs.
-1
-1
Training
pattern 1
>> p = [-0.5 1 -0.5 1; -1 0.5 -1 0.5; 0.5 1 0.5 1; -0.5 -1 -0.5 -1];
>> t = [-1 1 -1 1];
>> net = train(net, p, t);
Training
pattern 1
-0.5
-0.25
-1.00
-1.00
1.00
1.00
0.25
0.50
For
neuron 1
Performance Evaluation
ability)
Design a function to measure the distance/similarity of the target and output, or simply
loading.m
Reference