こんにちは、油層の岩石の 2 つの石油物理特性を井戸のログ値を使用して推定したいと考えています。また、MLP メソッドの Matlab (R2014b バージョン) にいくつかのニューラル ネットワーク コードがあります。
これは、私が単一の隠れ層で最適なニューロン数を決定するための興味深い手法を使用したと言うことが重要です: 最初にニューロン数を 5 に割り当て、このニューロン数を 5 に等しいステップ長に基づいて 100 数に増やしました。つまり: 5,10,15, ...,100
最適なニューロン数を決定するために、X 軸にニューロン数があり、Y 軸にエラー値 (トレーニング ステージの最後の反復) があるグラフをプロットするためのコードを書きました。以下にこのコードを書きました。
nnn1=5; % First Number of Neurons in Hidden Layer
nnnj=5; % Jump in Number of Neurons
nnnf=100; % Last Number of Neurons in Hidden Layer
% Training Network
it=25; % Max Number of Iteration
ii=0;
netopt{:}=1:nnnf;
for nnn=nnn1:nnnj:nnnf
ii=ii+1; nnn
net1=newff(p,t,[nnn nnn],{'purelin','purelin'},'traingd');
evalopt(ii)=10^5;
for i=1:it
[net1,tr,y,et]=train(net1,p,t); % Training
net1.divideParam.trainRatio=trainRatio1;
net1.divideParam.valRatio=valRatio1;
net1.divideParam.testRatio=testRatio1;
estval=sim(net1,p(:,tr.valInd));
eval=mse(estval-t(:,tr.valInd));
if eval<evalopt(ii)
netopt{(ii)}=net1; tropt(ii)=tr; evalopt(ii)=eval;
end
end
end
plot(nnn1:nnnj:nnnf,evalopt)
しかし、上記のコードの最後の行で「セクションの実行」ボタンを押すと、Matlab は次のエラー メッセージを表示します。Matlabでこのエラーを修正するために私を案内してください...私はすべてのコードを以下にもう一度書きました...
clc; clear; close all
data=xlsread('sarvak_normalized.xlsx'); % Input File
corrplot(data)
input=[1:9]; % Input Layer
p=data(:,input);
output=[10:11]; % Output Layer
t=data(:,output);
p=p'; t=t'; % Transposing Matrices
trainRatio1=.6;
valRatio1=.2;
testRatio1=.2;
%% Network Definition
nnn1=5; % First Number of Neurons in Hidden Layer
nnnj=5; % Jump in Number of Neurons
nnnf=100; % Last Number of Neurons in Hidden Layer
% Training Network
it=25; % Max Number of Iteration
ii=0;
netopt{:}=1:nnnf;
for nnn=nnn1:nnnj:nnnf
ii=ii+1; nnn
net1=newff(p,t,[nnn nnn],{'purelin','purelin'},'traingd');
evalopt(ii)=10^5;
for i=1:it
[net1,tr,y,et]=train(net1,p,t); % Training
net1.divideParam.trainRatio=trainRatio1;
net1.divideParam.valRatio=valRatio1;
net1.divideParam.testRatio=testRatio1;
estval=sim(net1,p(:,tr.valInd));
eval=mse(estval-t(:,tr.valInd));
if eval<evalopt(ii)
netopt{(ii)}=net1; tropt(ii)=tr; evalopt(ii)=eval;
end
end
end
plot(nnn1:nnnj:nnnf,evalopt)
nn=2
ptrain=p(:,tropt(nn).trainInd); ttrain=t(:,tropt(nn).trainInd); esttrain=sim(netopt{nn},ptrain);
ptest=p(:,tropt(nn).testInd); ttest=t(:,tropt(nn).testInd); esttest=sim(netopt{nn},ptest);
pval=p(:,tropt(nn).valInd); tval=t(:,tropt(nn).valInd); estval=sim(netopt{nn},pval);
estwhole=sim(netopt{nn},p);
plotregression(ttrain,esttrain,'Train',tval,estval,'Validation',...
ttest,esttest,'Test',t,estwhole,'Whole Data');
完全なコードの最後の行で「セクションの実行」ボタンを押すと、同じエラーメッセージが表示されます。「plotregression ...」ニューラルネットプロセスの3段階でモデルの精度を理解するため。
もちろん、Matlab は回帰グラフをプロットすることもありますが、「 plot(nnn1:nnnj:nnnf,evalopt) 」のエラー メッセージを表示し、逆にグラフをプロットしないこともあります。ありがとうございました...