I have this error with the code:Invalid function name '' WHY??????Help me!!!!
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
I want to customize a neural network that has two inputs with each 151 elements, two hidden layers with ,respectively, 151 and 5 neurons, weights between first hidden layer and second hidden layers are 1, weights between second hidden layer and output layer are learned,the output layer has 5 neurons.
Why don't I simulate this code? IN is a matrix 2x151 and T is a matrix 151x1
Data=load('data.txt');
T=load('data_target.txt');
IN=Data';
OUT=T';
%%Definizione indici per il test set
testInd = [1:2,125:150];
outInd = [1:2,125:150];
[testIn] = divideind(IN,testInd);
[testOut] = divideind(OUT,outInd);
[INn,ps]=mapminmax(IN); %normalizza i valori di ogni RIGA tra -1
[testInn,ps1]=mapminmax(testIn);
[INp,ps]=mapstd(INn); %trasforma la media e la deviazione std di ogni RIGA a 0 e 1
[testInp,ps2]=mapstd(testInn);
%Rete neurale
net=network(2,4);
net.numInputs = 2;
net.numLayers = 4;
net.layers{2}.size = 151;
net.layers{2}.transferFcn = 'radbas';
net.layers{3}.size=5;
net.layers{3}.transferFcn = 'radbas';
net.layers{4}.size=5;
net.layers{3}.transferFcn = 'purelin';
net.layerWeights{2,1}.value=1;
net.layerWeights{3,2}.learnFcn='learnwk';
net.trainParam.epochs = 1;
net.trainParam.show = 10;
net.trainParam.lr = 0.03;
net.trainParam.goal = 1e-5;
net.trainParam.max_fail = 1e+10;
net.divideFcn = 'divideind';
net.divideParam.trainInd = [1:2,35:121];
net.divideParam.valInd = [1:2,125:150];
net.initParam='initlay';
net.initFcn = 'initlay'; % set network init function
net.trainFcn = 'trainlm'; % set network training function
net.performFcn = 'mse';
view(net)
net = train(net,IN,OUT);
%%Simulazione Rete sul training set
r = sim(net,IN);
figure, plot(OUT,'*b');
hold on
plot(r,'or');
%%Simulazione Rete sul val
r2 = sim(net,testIn);
figure, plot(testOut,'*b');
hold on
plot(r2,'or');
2 件のコメント
Walter Roberson
2013 年 2 月 26 日
Which line of code is the error occurring at?
Sean de Wolski
2013 年 2 月 26 日
Paste the full text of the error message
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!