clear all;clc a=rand(1,1000); b=rand(1,1000); c=rand(1,1000); y=a*2+b*3+c*5 I=[a; b; c;] T=y net = newff([0 1;0 1 ;0 1],[10 1]); net=train(net,I,T); J1=sim(net,I); Op=sim(net,[1 1 1]');
As i am testing system with inputs [1 1 1] then the output must be neat to 10, but it gives 1. what is wrong with this code?
clear all; clc rng('default') % Initialized the RNG a = rand(1,1000); b = rand(1,1000); c = rand(1,1000); y = a*2+b*3+c*5; % Added semicolon I = [a; b; c;]; % Added semicolon T = y; % Added semicolon net = newff([0 1;0 1 ;0 1],[10 1]); net=train(net,I,T); J1=sim(net,I); MSE = mse(J1-T) Op=sim(net,[1 1 1]') % Warning: NEWFF used in an obsolete % way. % > In obs_use at 18 % In newff>create_network at 127 % In newff at 102 % In Untitledgh at 9 % See help for NEWFF to update calls to % the new argument list. % MSE = 19.6749 % Op = 1 net = newff( I ,T ,10 ); % Current version net=train(net,I,T); J1=sim(net,I); MSE = mse(J1-T) Op=sim(net,[1 1 1]') % MSE = 4.4650e-009 % Op = 9.9969
To be sure the obsolete version contains a bug,
Ntrials = 15 for i=1:Ntrials net = newff([0 1;0 1 ;0 1],[10 1]); net=train(net,I,T); J1=sim(net,I); MSE(i) = mse(J1-T); Op(i)=sim(net,[1 1 1]'); end result = [ MSE' OP' ] % result = % % 19.6749 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 19.7560 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 19.6749 1.0000 % 22.1988 1.0000 % 19.6749 1.0000 % 19.6749 1.0000
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.