Sie sind auf Seite 1von 12

NAMA

AGUNG PRADANA ISKANDAR

BP

1323030

KELAS

XX B

UJIAN EXPERT SYSTEM ( SELASA / 3/ 09 / 2014)


To get started, select "MATLAB Help" from the Help menu.

>> 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 =

1.1697 -0.0364 -0.1287 -0.2193 1.1290 -0.2487


-0.5183 0.7544 -1.0565 0.3396 0.4730 0.8519
0.2358 0.5783 0.8072 0.9830 -0.7358 0.9335

>> net.b{1}

ans =

-14.5383
-4.9245
-22.1567

>> net.LW{2,1}

ans =

-0.5764 -2.8400 2.0117


2.1509 -0.8039 -2.6781

>> net.b{2}

ans =

3.5278
3.5278

>> [a,Pf,Af,e,Perf]=sim(net,p,[],[],t)

a=

0.9930 0.9843 0.9399 0.9993 0.9752 0.9994 0.9969 0.9997

0.9998 0.9722

0.3162 0.9279 0.4096 0.2853 0.2142 0.3231 0.2405 0.3863

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

TRAINGD, Maximum epoch reached, performance goal was not met.

net =

Neural Network object:

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:

inputs: {1x1 cell} of inputs


layers: {2x1 cell} of layers
outputs: {1x2 cell} containing 1 output
targets: {1x2 cell} containing 1 target
biases: {2x1 cell} containing 2 biases
inputWeights: {2x1 cell} containing 1 input weight
layerWeights: {2x2 cell} containing 1 layer weight

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

weight and bias values:

IW: {2x1 cell} containing 1 input weight matrix


LW: {2x2 cell} containing 1 layer weight matrix
b: {2x1 cell} containing 2 bias vectors

other:

userdata: (user stuff)

>> 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 =

Neural Network object:

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:

inputs: {1x1 cell} of inputs


layers: {2x1 cell} of layers
outputs: {1x2 cell} containing 1 output
targets: {1x2 cell} containing 1 target
biases: {2x1 cell} containing 2 biases
inputWeights: {2x1 cell} containing 1 input weight
layerWeights: {2x2 cell} containing 1 layer weight

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

weight and bias values:

IW: {2x1 cell} containing 1 input weight matrix


LW: {2x2 cell} containing 1 layer weight matrix

b: {2x1 cell} containing 2 bias vectors

other:

userdata: (user stuff)

>> net.trainParam.epochs = 10000;


net.trainParam.show = 500;
net.trainParam.goal = 0.01;
net=train(net,p,t)
TRAINGD, Epoch 0/10000, MSE 0.464037/0.01, Gradient 0.0949139/1e-010
TRAINGD, Epoch 500/10000, MSE 0.436584/0.01, Gradient 0.0568063/1e-010
TRAINGD, Epoch 1000/10000, MSE 0.424991/0.01, Gradient 0.0412545/1e-010
TRAINGD, Epoch 1500/10000, MSE 0.418087/0.01, Gradient 0.0336246/1e-010
TRAINGD, Epoch 2000/10000, MSE 0.413261/0.01, Gradient 0.0287174/1e-010
TRAINGD, Epoch 2500/10000, MSE 0.409662/0.01, Gradient 0.0250458/1e-010
TRAINGD, Epoch 3000/10000, MSE 0.40689/0.01, Gradient 0.0221189/1e-010
TRAINGD, Epoch 3500/10000, MSE 0.404707/0.01, Gradient 0.0197225/1e-010
TRAINGD, Epoch 4000/10000, MSE 0.402957/0.01, Gradient 0.0177323/1e-010
TRAINGD, Epoch 4500/10000, MSE 0.401532/0.01, Gradient 0.0160627/1e-010
TRAINGD, Epoch 5000/10000, MSE 0.400355/0.01, Gradient 0.0146495/1e-010
TRAINGD, Epoch 5500/10000, MSE 0.39937/0.01, Gradient 0.0134436/1e-010
TRAINGD, Epoch 6000/10000, MSE 0.398536/0.01, Gradient 0.0124068/1e-010
TRAINGD, Epoch 6500/10000, MSE 0.397822/0.01, Gradient 0.011509/1e-010
TRAINGD, Epoch 7000/10000, MSE 0.397204/0.01, Gradient 0.0107265/1e-010
TRAINGD, Epoch 7500/10000, MSE 0.396666/0.01, Gradient 0.0100403/1e-010
TRAINGD, Epoch 8000/10000, MSE 0.396192/0.01, Gradient 0.00943531/1e-010
TRAINGD, Epoch 8500/10000, MSE 0.395772/0.01, Gradient 0.00889923/1e-010
TRAINGD, Epoch 9000/10000, MSE 0.395397/0.01, Gradient 0.00842211/1e-010
TRAINGD, Epoch 9500/10000, MSE 0.395061/0.01, Gradient 0.00799584/1e-010
TRAINGD, Epoch 10000/10000, MSE 0.394756/0.01, Gradient 0.00761378/1e-010
TRAINGD, Maximum epoch reached, performance goal was not met.

net =

Neural Network object:

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:

inputs: {1x1 cell} of inputs


layers: {2x1 cell} of layers
outputs: {1x2 cell} containing 1 output
targets: {1x2 cell} containing 1 target
biases: {2x1 cell} containing 2 biases
inputWeights: {2x1 cell} containing 1 input weight
layerWeights: {2x2 cell} containing 1 layer weight

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

weight and bias values:

IW: {2x1 cell} containing 1 input weight matrix


LW: {2x2 cell} containing 1 layer weight matrix
b: {2x1 cell} containing 2 bias vectors

other:

userdata: (user stuff)

>> net.trainParam.epochs = 100000;


>> net.trainParam.show = 500;
net.trainParam.goal = 0.01;
>> net.trainParam.show = 10000;
>> net=train(net,p,t)
TRAINGD, Epoch 0/100000, MSE 0.394756/0.01, Gradient 0.00761378/1e-010
TRAINGD, Epoch 10000/100000, MSE 0.391391/0.01, Gradient 0.00527399/1e-010
TRAINGD, Epoch 20000/100000, MSE 0.386837/0.01, Gradient 0.00833613/1e-010
TRAINGD, Epoch 30000/100000, MSE 0.379341/0.01, Gradient 0.00843974/1e-010
TRAINGD, Epoch 40000/100000, MSE 0.0625971/0.01, Gradient 2.50649/1e-010
TRAINGD, Epoch 50000/100000, MSE 0.0125981/0.01, Gradient 0.0105182/1e-010
TRAINGD, Epoch 52819/100000, MSE 0.00999961/0.01, Gradient 0.0087458/1e-010
TRAINGD, Performance goal met.

net =

Neural Network object:

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:

inputs: {1x1 cell} of inputs


layers: {2x1 cell} of layers
outputs: {1x2 cell} containing 1 output
targets: {1x2 cell} containing 1 target
biases: {2x1 cell} containing 2 biases
inputWeights: {2x1 cell} containing 1 input weight
layerWeights: {2x2 cell} containing 1 layer weight

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

weight and bias values:

IW: {2x1 cell} containing 1 input weight matrix


LW: {2x2 cell} containing 1 layer weight matrix
b: {2x1 cell} containing 2 bias vectors

other:

userdata: (user stuff)

>> [a,Pf,Af,e,Perf]=sim(net,p,[],[],t)

a=

0.1743 0.0092 0.8985 0.0829 0.0076 0.1630 0.0139 0.8562

0.0077 0.8253

0.8217 0.9986 0.0669 0.9499 0.9992 0.9462 0.9966 0.1528

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.0106 0.0215 0.0115 0.0134 0.0071 0.1630 0.0441 0.0090

0.0122 0.0139

0.9988 0.9904 0.9986 0.9970 0.9992 0.9462 0.9559 0.9988

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

>>

Das könnte Ihnen auch gefallen