Info
This question is closed. Reopen it to edit or answer.
why my training command is Showing error and not able to view my net
1 view (last 30 days)
Show older comments
Hello All,
As i am new and persuing my research on Neural Network, in my intial stage am trying to code simple network of 2:4:1 architecture.
below is my code please check as i am not able to remove error for training and not able to view my net too.
please help that would be very needful as i have to present my work next week.
clc
g=load('sample file.txt');
P=g(1:1:63,1:2);
O=g(1:1:63,3);
net=network;
net.numInputs= 2;
net.numLayers= 2;
net.layers{1}.size= 4;
net.layers{2}.size= 1;
net.inputconnect(1,2)= 2;
net.IW{1,1};
net.LW{2,1};
net.b{1};
net.b{2};
net.layerConnect = [0 0; 1 0];
net.biasConnect = [1;1];
net.outputConnect = [0 1];
% Setup Division of Data for Training, Validation, Testing
%net.divideParam.trainRatio = 70/100;
%net.divideParam.valRatio = 15/100;
%net.divideParam.testRatio = 15/100;
net.divideFcn = 'dividerand';
% normalize the data {-1,+1};
[Pn,Ps] = mapminmax(P);
[On,Os] = mapminmax(O);
% Define transfer Function for each layer
net.layers{1}.transferFcn = 'purelin';
net.layers{2}.transferFcn = 'logsig';
net.performFcn = 'mse'; % Mean Squared Error
% train the network
%net =train(net,Pn,On);
net.trainFcn= 'trainlm';
% Train the Network
net.train = train(net,Pn,On);
% Test the Network
y = net(P);
e = gsubtract(O,y);
performance = perform(net,O,y);
% View the Network
net.view;
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!