我自己写的东西,但是目标和输出差距也太大了点,真心搞不懂啊,就是个凝汽器故障诊断,老师说老简单了,是我太笨了吧,我新手,求关注啊!求帮助,谢谢
p=[1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0;1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0;1 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0;1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0;0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0;0 1 0 0 0 0 1 0 1 0 0 0 0 1 1 0 0;0 1 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0;0 1 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0;0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0;0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0;0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1]
p =
1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0
1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0
1 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0
1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
0 1 0 0 0 0 1 0 1 0 0 0 0 1 1 0 0
0 1 0 0 0 1 0 1 0 1 0 0 0 1 1 0 0
0 1 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0
0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0
0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0
0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1
>> t=[1 0 0 0 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 0 1 0 0;0 0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 0 1]
t =
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 1
>> p=p';
>> t=t';
>> net=newff(p,t,{10},{'tansig','tansig'},'trainlm');
>> net.trainParam.goal=0.003;
>> net.trainParam.epochs=5000;
>> [net,tr]=train(net,p,t)
net =
Neural Network
name: 'Custom Neural Network'
efficiency: .cacheDelayedInputs, .flattenTime,
.memoryReduction, .flattenedTime
userdata: (your custom info)
dimensions:
numInputs: 1
numLayers: 2
numOutputs: 1
numInputDelays: 0
numLayerDelays: 0
numFeedbackDelays: 0
numWeightElements: 301
sampleTime: 1
connections:
biasConnect: [1; 1]
inputConnect: [1; 0]
layerConnect: [0 0; 1 0]
outputConnect: [0 1]
subobjects:
inputs: {1x1 cell array of 1 input}
layers: {2x1 cell array of 2 layers}
outputs: {1x2 cell array of 1 output}
biases: {2x1 cell array of 2 biases}
inputWeights: {2x1 cell array of 1 weight}
layerWeights: {2x2 cell array of 1 weight}
functions:
adaptFcn: 'adaptwb'
adaptParam: (none)
derivFcn: 'defaultderiv'
divideFcn: 'dividerand'
divideParam: .trainRatio, .valRatio, .testRatio
divideMode: 'sample'
initFcn: 'initlay'
performFcn: 'mse'
performParam: .regularization, .normalization
plotFcns: {'plotperform', plottrainstate,
plotregression}
plotParams: {1x3 cell array of 3 params}
trainFcn: 'trainlm'
trainParam: .showWindow, .showCommandLine, .show, .epochs,
.time, .goal, .min_grad, .max_fail, .mu, .mu_dec,
.mu_inc, .mu_max
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
methods:
adapt: Learn while in continuous use
configure: Configure inputs & outputs
gensim: Generate Simulink model
init: Initialize weights & biases
perform: Calculate performance
sim: Evaluate network outputs given inputs
train: Train network with examples
view: View diagram
unconfigure: Unconfigure inputs & outputs
evaluate: outputs = net(inputs)
tr =
trainFcn: 'trainlm'
trainParam: [1x1 struct]
performFcn: 'mse'
performParam: [1x1 struct]
derivFcn: 'defaultderiv'
divideFcn: 'dividerand'
divideMode: 'sample'
divideParam: [1x1 struct]
trainInd: [3 4 7 8 9 10 11]
valInd: [1 2]
testInd: [5 6]
stop: 'Performance goal met.'
num_epochs: 5
trainMask: {[11x11 double]}
valMask: {[11x11 double]}
testMask: {[11x11 double]}
best_epoch: 3
goal: 0.0030
states: {'epoch' 'time' 'perf' 'vperf' 'tperf' 'mu' 'gradient' 'val_fail'}
epoch: [0 1 2 3 4 5]
time: [0.2610 0.3960 0.4200 0.4560 0.4740 0.4940]
perf: [0.5254 0.2044 0.1309 0.0548 0.0362 0.0028]
vperf: [0.3965 0.1823 0.2113 0.1067 0.1128 0.1507]
tperf: [0.5361 0.2193 0.1852 0.1515 0.1599 0.1454]
mu: [1.0000e-03 1.0000e-04 1.0000e-05 1.0000e-04 1.0000e-05 1.0000e-06]
gradient: [0.1669 0.1778 0.2073 0.0977 0.1404 0.0221]
val_fail: [0 0 1 0 1 2]
best_perf: 0.0548
best_vperf: 0.1067
best_tperf: 0.1515
>> a=sim(net,p)
a =
Columns 1 through 8
0.0013 0.0051 0.0045 0.0015 0.0715 0.0049 0.0213 0.0061
0.0166 0.0020 0.0000 0.0162 0.0182 0.0014 0.0585 0.2230
0.0028 0.0008 0.9517 0.0128 0.0020 0.0786 0.0384 0.0019
0.5422 0.0063 0.0959 0.2451 0.0036 0.0002 0.1700 0.0452
0.0163 0.0018 0.0806 0.0290 0.0041 0.0190 0.0069 0.0727
0.0145 0.0205 0.0625 0.1302 0.0261 0.0186 0.0421 0.1343
0.1057 0.0064 0.0484 0.0828 0.0254 0.0115 0.8728 0.6152
0.0722 0.0039 0.0013 0.0021 0.1279 0.0011 0.5016 0.9676
0.0072 0.0062 0.0438 0.0679 0.6085 0.2168 0.9540 0.9995
0.2047 0.0338 0.0695 0.0140 0.1626 0.0000 0.0356 0.2438
0.0000 0.0053 0.0404 0.0366 0.0352 0.9510 0.0079 0.1147
Columns 9 through 11
0.0179 0.0465 0.0152
0.0624 0.0044 0.0029
0.0247 0.0006 0.0424
0.0645 0.0005 0.0003
0.0520 0.0019 0.0209
0.0285 0.0044 0.0237
0.2399 0.0094 0.0061
0.2872 0.2565 0.0020
0.9618 0.5802 0.1597
0.2327 0.5602 0.0000
0.0070 0.0017 0.9176

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/21092.html