Beruflich Dokumente
Kultur Dokumente
BP
1323030
KELAS
XX B
>> p = [7.73 7.96 8.29 7.37 8.78 8.21 7.74 7.37 9.43 8.21;7.15 7.15 7.61 7.15 8.59 6.82 6.68 7.15 7.34 6.53;8.82 8.19 8.56 9.72 8.81 9.29 8.82 10 9.29 8.19;7.45 7.71
8.04 8.03 8.12 7.58 8.68 7.45 7.45 7.33;7.06 6.96 8.33 6.86 7.6 6.86 7.06 6.96 6.33 7.06;8.47 7.2 8.55 8.47 8.23 8.79 8.21 8.21 8.79 9.23];
>> t = [0 0 1 0 0 0 0 1 0 1;1 1 0 1 1 1 1 0 1 0];
>> net = newff(minmax(p),[3,2],{'tansig','logsig'},'traingd');
>> net.IW{1,1}
ans =
>> net.b{1}
ans =
-14.5383
-4.9245
-22.1567
>> net.LW{2,1}
ans =
>> net.b{2}
ans =
3.5278
3.5278
>> [a,Pf,Af,e,Perf]=sim(net,p,[],[],t)
a=
0.9998 0.9722
0.3812 0.2970
Pf =
[]
Af =
[]
e=
-0.9930 -0.9843 0.0601 -0.9993 -0.9752 -0.9994 -0.9969 0.0003 -0.9998 0.0278
0.6838 0.0721 -0.4096 0.7147 0.7858 0.6769 0.7595 -0.3863 0.6188 -0.2970
Perf =
0.5163
>> net=train(net,p,t)
TRAINGD, Epoch 0/100, MSE 0.51627/0, Gradient 0.696496/1e-010
TRAINGD, Epoch 25/100, MSE 0.483746/0, Gradient 0.143741/1e-010
TRAINGD, Epoch 50/100, MSE 0.480043/0, Gradient 0.112495/1e-010
TRAINGD, Epoch 75/100, MSE 0.47699/0, Gradient 0.108779/1e-010
TRAINGD, Epoch 100/100, MSE 0.474111/0, Gradient 0.105797/1e-010
net =
architecture:
numInputs: 1
numLayers: 2
biasConnect: [1; 1]
inputConnect: [1; 0]
layerConnect: [0 0; 1 0]
outputConnect: [0 1]
targetConnect: [0 1]
numOutputs: 1 (read-only)
numTargets: 1 (read-only)
numInputDelays: 0 (read-only)
numLayerDelays: 0 (read-only)
subobject structures:
functions:
adaptFcn: 'trains'
initFcn: 'initlay'
performFcn: 'mse'
trainFcn: 'traingd'
parameters:
adaptParam: .passes
initParam: (none)
performParam: (none)
trainParam: .epochs, .goal, .lr, .max_fail,
.min_grad, .show, .time
other:
>> net=train(net,p,t)
TRAINGD, Epoch 0/100, MSE 0.474111/0, Gradient 0.105797/1e-010
TRAINGD, Epoch 25/100, MSE 0.471386/0, Gradient 0.10299/1e-010
TRAINGD, Epoch 50/100, MSE 0.468802/0, Gradient 0.100269/1e-010
TRAINGD, Epoch 75/100, MSE 0.466354/0, Gradient 0.097579/1e-010
TRAINGD, Epoch 100/100, MSE 0.464037/0, Gradient 0.0949139/1e-010
TRAINGD, Maximum epoch reached, performance goal was not met.
net =
architecture:
numInputs: 1
numLayers: 2
biasConnect: [1; 1]
inputConnect: [1; 0]
layerConnect: [0 0; 1 0]
outputConnect: [0 1]
targetConnect: [0 1]
numOutputs: 1 (read-only)
numTargets: 1 (read-only)
numInputDelays: 0 (read-only)
numLayerDelays: 0 (read-only)
subobject structures:
functions:
adaptFcn: 'trains'
initFcn: 'initlay'
performFcn: 'mse'
trainFcn: 'traingd'
parameters:
adaptParam: .passes
initParam: (none)
performParam: (none)
trainParam: .epochs, .goal, .lr, .max_fail,
.min_grad, .show, .time
other:
net =
architecture:
numInputs: 1
numLayers: 2
biasConnect: [1; 1]
inputConnect: [1; 0]
layerConnect: [0 0; 1 0]
outputConnect: [0 1]
targetConnect: [0 1]
numOutputs: 1 (read-only)
numTargets: 1 (read-only)
numInputDelays: 0 (read-only)
numLayerDelays: 0 (read-only)
subobject structures:
functions:
adaptFcn: 'trains'
initFcn: 'initlay'
performFcn: 'mse'
trainFcn: 'traingd'
parameters:
adaptParam: .passes
initParam: (none)
performParam: (none)
trainParam: .epochs, .goal, .lr, .max_fail,
other:
net =
architecture:
numInputs: 1
numLayers: 2
biasConnect: [1; 1]
inputConnect: [1; 0]
layerConnect: [0 0; 1 0]
outputConnect: [0 1]
targetConnect: [0 1]
numOutputs: 1 (read-only)
numTargets: 1 (read-only)
numInputDelays: 0 (read-only)
numLayerDelays: 0 (read-only)
subobject structures:
functions:
adaptFcn: 'trains'
initFcn: 'initlay'
performFcn: 'mse'
trainFcn: 'traingd'
parameters:
adaptParam: .passes
initParam: (none)
performParam: (none)
trainParam: .epochs, .goal, .lr, .max_fail,
.min_grad, .show, .time
other:
>> [a,Pf,Af,e,Perf]=sim(net,p,[],[],t)
a=
0.0077 0.8253
0.9992 0.0964
Pf =
[]
Af =
[]
e=
-0.1743 -0.0092 0.1015 -0.0829 -0.0076 -0.1630 -0.0139 0.1438 -0.0077 0.1747
0.1783 0.0014 -0.0669 0.0501 0.0008 0.0538 0.0034 -0.1528 0.0008 -0.0964
Perf =
0.0100
>> a'
ans =
0.1743 0.8217
0.0092 0.9986
0.8985 0.0669
0.0829 0.9499
0.0076 0.9992
0.1630 0.9462
0.0139 0.9966
0.8562 0.1528
0.0077 0.9992
0.8253 0.0964
>> p1 = [8.94 7.74 8.52 7.74 8.9 8.21 7.54 8.52 8.21 7.74;9.63 7.15 6.82 6.98 6.68 6.82 7.34 7.15 7.15 6.68;8.9 7.73 9.29 8.82 7.18 9.29 8.48 8.19 8.48 8.82;8.84 8.43
7.71 7.71 7.71 7.58 7.86 7.71 7.58 8.68;8.97 7.28 6.77 6.77 6.68 6.86 7.53 7.06 7.28 7.06;7.85 8.21 8.47 7.8 8.21 8.47 7.8 8.21 8.79 7.63 8.47 7.8 8.21];
??? Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.
>> p1 = [8.94 7.74 8.52 7.74 8.9 8.21 7.54 8.52 8.21 7.74;9.63 7.15 6.82 6.98 6.68 6.82 7.34 7.15 7.15 6.68;8.9 7.73 9.29 8.82 7.18 9.29 8.48 8.19 8.48 8.82;8.84 8.43
7.71 7.71 7.71 7.58 7.86 7.71 7.58 8.68;8.97 7.28 6.77 6.77 6.68 6.86 7.53 7.06 7.28 7.06;7.85 8.21 8.47 7.8 8.21 8.79 7.63 8.47 7.8 8.21 ];
>> t1 = [0 1 0 0 0 1 0 0 0 0;1 0 1 1 1 0 1 1 1 1];
>> [a,Pf,Af,e,Perf]=sim(net,p1,[],[],t1)
a=
0.0122 0.0139
0.9977 0.9966
Pf =
[]
Af =
[]
e=
-0.0106 0.9785 -0.0115 -0.0134 -0.0071 0.8370 -0.0441 -0.0090 -0.0122 -0.0139
0.0012 -0.9904 0.0014 0.0030 0.0008 -0.9462 0.0441 0.0012 0.0023 0.0034
Perf =
0.1770
>> a'
ans =
0.0106 0.9988
0.0215 0.9904
0.0115 0.9986
0.0134 0.9970
0.0071 0.9992
0.1630 0.9462
0.0441 0.9559
0.0090 0.9988
0.0122 0.9977
0.0139 0.9966
>>