Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Improving ANN results
Replies: 16   Last Post: Nov 13, 2013 9:10 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Greg Heath

Posts: 5,950
Registered: 12/7/04
Re: Improving ANN results
Posted: Oct 15, 2013 7:30 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Greg Heath" <heath@alumni.brown.edu> wrote in message <l3khqr$1fe$1@newscl01ah.mathworks.com>...
> "chaudhry " <bilal_zafar9@yahoo.com> wrote in message <l3ebuu$evs$1@newscl01ah.mathworks.com>...
>

> > How to improve ANN results by reducing error through hidden layer size, through MSE, or by using while loop?
>
> Your data is not a good learning example. (Small size, constant x(1,:), weak relationship between input and target )
>
> 1. Practice on MATLAB data (e.g., simplefit_dataset)


close all, clear all, clc
format short

x = [31 9333 2000;31 9500 1500;31 9700 2300;31 9700 2320;...
31 9120 2230;31 9830 2420;31 9300 2900;31 9400 2500]'
t = [35000;23000;3443;2343;1244;9483;4638;4739]'
xnew = [31 9333 2000]'

% [ x, t ] = simplefit_dataset; % Better learning example

[ I N ] = size( x ) % [ 3 8 ]
[ O N ] = size( t ) % [ 1 8 ]

%Standardization?
varx = var( x') % 1e5 * [ 0 0.585 1.63 ] %Huge
vart = var( t ) % 1.47e8 % Ditto

% Delete x(1,:) and standardize

x = x(2:3,:); %Omit for simplefit_dataset
zx = zscore(x',1)';
zt = zscore(t',1)';
MSE00 = var(t',1) % = 1 Reference MSE
Ntst = round(0.15*N) % = 1 default
Ntrials = max(10,30/Ntst) % 30

% Use default No. of hidden nodes (10)

net = fitnet;

rng(0)
for i=1:Ntrials
net = configure(net,x,t);
[net tr ] = train(net,x,t);
R2trn(i,1) = 1 - tr.best_perf/MSE00;
R2val(i,1) = 1 - tr.best_vperf/MSE00;
R2tst(i,1) = 1 - tr.best_tperf/MSE00;
end
R2s = [ R2trn R2val R2tst ]

minR2s = min(R2s) % -13.2021 -17.1237 -22.9422
medR2s = median(R2s) % 0.7096 0.4177 0.1100
meanR2s = mean(R2s) % -0.8757 -1.2760 -1.8358
stdR2s = std(R2s) % 3.4060 3.9508 4.8567
maxR2s = max(R2s) % 1.0000 1.0000 0.9965
sortR2s = sort(R2s)

% sortR2s = -13.2021 -17.1237 -22.9422
% -10.4006 -9.8592 -8.5426
% -4.5224 -6.3693 -6.8485
% -4.1019 -5.0681 -6.5369
% -3.7170 -3.6865 -5.7350
% -2.0340 -2.4595 -5.0384
% -1.7259 -2.4565 -4.0096
% -1.3995 -1.6079 -3.6787
% -1.2526 -1.6025 -0.5167
% -0.2069 -1.0937 -0.3695
% -0.1213 -0.6480 -0.2804
% 0.1603 -0.2390 -0.2782
% 0.4618 0.1275 -0.2124
% 0.6146 0.1944 -0.1174
% 0.6782 0.2760 0.0623
% 0.7410 0.5594 0.1577
% 0.9138 0.7007 0.2807
% 0.9301 0.7012 0.3786
% 0.9488 0.7098 0.4315
% 0.9736 0.7654 0.4789
% 0.9917 0.9362 0.4834
% 0.9999 0.9819 0.6334
% 1.0000 0.9890 0.7886
% 1.0000 0.9957 0.8014
% 1.0000 0.9982 0.8439
% 1.0000 0.9996 0.9090
% 1.0000 0.9996 0.9091
% 1.0000 0.9997 0.9253
% 1.0000 0.9998 0.9510
% 1.0000 1.0000 0.9965

% Note that only 2 of 30 designs have R2tst >= 0.95 !!!

% In contrast, for the simplefit_data set (x(1,:) NOT deleted)
%
% Ntrials = 10
% R2s = 1.0000 1.0000 1.0000
% 1.0000 1.0000 1.0000
% 1.0000 1.0000 1.0000
% 1.0000 1.0000 1.0000
% 1.0000 1.0000 1.0000
% 1.0000 1.0000 1.0000
% 1.0000 1.0000 1.0000
% 1.0000 1.0000 1.0000
% 1.0000 0.9997 1.0000
% 1.0000 1.0000 0.9999

Now try minimizing the number of hidden nodes for the simplefit example.

Hope this helps.

Greg



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.