Pastebin
Paste #1297: matlab
< previous paste - next paste>
Pasted by tdn
%%%%%%%%%%%%
output:
samples =
0.0350 0.0162 0.9359 0.6757 0.2786
-0.0113 1.1361 -0.0509 1.0286 -0.2267
targetsamples =
0 1 1 0 0
ans =
2 5
ans =
1 5
ans =
2 500
ans =
1 500
% Set training data to first half of data
data_t = data(1:500,:);
% Set performance data to second half of data
data_p = data(501:end,:);
%data = load('xor-small.txt')
data = load('noisy-xor.txt');
P=data(1:5,2:end)';
T=data(1:5,1)';
samples=P
targetsamples=T
trainingInput = data(501:end,2:end)';
trainingTarget = data(501:end,1)';
size(P)
size(T)
size(trainingInput)
size(trainingTarget)
net = newff(samples, targetsamples, [], {'tansig'}, 'trainlm');
%net.biasConnect(layerNumber) = booleanValue;
net.biasConnect(1) = 1;
net.trainParam.epochs = 100;
[net trainingPerformance] = train(net, trainingInput, trainingTarget);
trainingPerformance
Training with TRAINLM.
??? Attempt to reference field of non-structure array.
Error in ==> nntraintool at 75
result = trainTool.isStopped;
Error in ==> trainlm at 288
[userStop,userCancel] = nntraintool('check');
Error in ==> network.train at 219
[net,tr] = feval(net.trainFcn,net,tr,trainV,valV,testV);
Error in ==> nn at 154
[net trainingPerformance] = train(net, trainingInput, trainingTarget);
New Paste
Go to most recent paste.