how to decrease fluctuation in neural network results?

when i run my ANN code it gives me result ...some times very good and sometimes very bad. so how to decrease fluctuations in the result and and some times performance curve show overfitting although with small data and on jst running the program once.
source code is given below:

This is my source code and I want to reduce the possible errors. When running this code there is a lot of difference between trained output to target. I have tried different ways but didn't work so please help me reducing it.

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


inputs =(a);
targets =[g];

% Create a Fitting Network
hiddenLayerSize = 1;
net = fitnet(hiddenLayerSize);

% Choose Input and Output Pre/Post-Processing Functions
% For a list of all processing functions type: help nnprocess
net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'};


% Setup Division of Data for Training, Validation, Testing
% For a list of all data division functions type: help nndivide
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;

% For help on training function 'trainlm' type: help trainlm
% For a list of all training functions type: help nntrain
net.trainFcn = 'trainlm'; % Levenberg-Marquardt
% Choose a Performance Function
% For a list of all performance functions type: help nnperformance
net.performFcn = 'mse'; % Mean squared error

% Choose Plot Functions
% For a list of all plot functions type: help nnplot
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
  'plotregression','plotconfusion' 'plotfit','plotroc'};
% Train the Network
[net,tr] = train(net,inputs,targets);
plottrainstate(tr)

% Test the Network
outputs = net(inputs)
errors = gsubtract(targets,outputs)
fprintf('errors = %4.3f\t',errors);
performance = perform(net,targets,outputs);

% Recalculate Training, Validation and Test Performance
trainTargets = targets .* tr.trainMask{1};
valTargets = targets .* tr.valMask{1};
testTargets = targets .* tr.testMask{1};
trainPerformance = perform(net,trainTargets,outputs);
valPerformance = perform(net,valTargets,outputs);
testPerformance = perform(net,testTargets,outputs);

% View the Network
view(net);
sc=sim(net,h 
0
10/14/2013 8:22:05 PM
comp.soft-sys.matlab 209009 articles. 11 followers. lunamoonmoon (258) is leader. Post Follow

0 Replies
194 Views

Similar Articles

[PageSpeed] 28

Reply:

Similar Artilces:

Neural Network Architecture with MATLAB Neural Network Toolbox
Dear neural network experts, I would like to make a neural network model for a situation when some of the input variables can interact, while others don't have any interactions. This information is based on logical considerations and I have to include it into the architecture of the net. For example, I have 3 different groups of input variables. Within each groups the variables are disjunct (i.e. no interaction). Variables of different groups may interact. This would result in either - restrictions to some weights of a network consisting of completely inter-linked neurons (i.e. some weight...

From Matlab neural network toolbox to matlab code
Hi All, I have been working with neural network toolbox in matlab 7 for the calibration and validation optimization problems. but i wanna to do it with matlab code. is it possible to transform the things that happen in toolbox, training process and adapting outputs get via code.. is there anyone who transform the things happen in toolbox to codes. "murat " <muratt59@gmail.com> wrote in message <iabd8c$8pc$1@fred.mathworks.com>... > Hi All, > > I have been working with neural network toolbox in matlab 7 for the calibration and validation optimization...

neural network: Recurrent Neural Networks
Hi Greg and Anders, thanks for your help of my backpropagation topic. Now I switch to recurrent neural networks. My question: 1. Does it the recurrent neural networks need to divide input data into training, validation and testing 3 sets? I tried to convert my previous brackpro code into recurrent but it prompt out the error that the "train" code section has too many input arguements, which include VV and TV... Felix Hi I tried to use Elam network. One strange result came to me. I used 10 hidden units it shown that the preformance goal is not met. and the mse is about 8.5 . Then ...

Matlab for neural network
Dear Sir, I am final year engeering student. I am doing final year project in neural network. Can you give me the algorithm for random number generation used in matlab. Also I want how the number of training patterns choosen as a batch form the given traing data set. Please reply me as early as possible. Thank You. "suresh kale" <ksuresh005@gmail.com> wrote in message <gl6h7q$cc6$1@fred.mathworks.com>... > Dear Sir, > I am final year engeering student. I am doing final year project in neural net...

Neural Network in Matlab
I'm totally new to neural network and Matlab, but I'm required to do some work with it. So hopefully all the experts out here can help me a bit... The situation is like this: Let's say I have a set of data, eg. input from 1 to 100. For each input, I have a corresponding output set of 5 variables. Example: input=1, output: x1=2.2, x2=3.4, x3= 5.7, x4=8.9, x5= 15.6 input=2, output: x1=2.3, x2=3.5, x3=5.9, x4=8.6, x5=14.7 input=3, output: x1=2.4, x2=3.6, x3=6.2, x4=8.5, x5=14.2 and so on. The purpose is to train these data and come out with a neural network so that when we give a...

Neural Network in MATLAB
Hi everybody, How you doing ?? I have just completed my Btech 3yr in IIT KGP an working on my Intern in UWA Perth. In which, I am preparing one ANN model which can predict P-Adsorbtion of any soil sample for training and all I have got 95 soil samples data with 20 components of each sample and I also have corresponding 95 output. Now for that I am using ann fitting tool of MATLAB. Where after training my regression plots is'nt coming right as one of the plot is showing the value of regression coff =1 which is only possible for ideal case. I am using evrything default which is given there...

neural network predictiver controller in neural network toolbox
I got some question that would like to ask about the minimizaton routine in neural network predictive controller in neural network toolbox. 1. Is there any method to calculate the control signal which minimize the performance index beside using Simulink? Any Matlab command which is relevant for minimization of performance index? 2. What is the teory for minimization routine like csrchbac? Is there any reference that I can refer? I am looking forward for any reply from any other Matlab user. Thank you very much for spending your time to read my message. Thanks again. Hi, G.H.Heng you work ...

experimenting neural network in matlab
I would like to get some reference on usage of neural network with matlab. How do I enumerate a BPNN using matlab. Nabeel. "Nabeel" <starter.matlab@example.com> wrote in message news:hp3uqo$o2q$1@fred.mathworks.com... >I would like to get some reference on usage of neural network with matlab. > How do I enumerate a BPNN using matlab. http://www.mathworks.com/access/helpdesk/help/toolbox/nnet/backprop.html#12953 -- Steve Lord slord@mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ On Apr 2, 1:20=A0am, &q...

how to get neural network result
If NN is trained with train(net,P,T). Let training of data has been done for images and generate matrices for P. T is the output assigned for respective P image matrices. Now, How to test the network with testing data? where testing data is matrix form of images. Do we need to run sim(net, test_matrix)? If yes, how to interpret output? ...

Probabilistic Neural Network and Radial basis function Neural Network
I am a final year student in B.Tech Information Technology. I am doing a project related to object recoginition using Probabilistic Neural Network and Radial basis function Neural Network. Please send me the running code of these networks. Thanx ...

matlab webserver and neural network
hi, all I'm using matlab for trainning my neural network, which display the results to the web browser through matlab webserver. When, trainning the neural network, (when the program executes the code net1=train(Net, P,T). the web browser display the internal error. I've check the error.log of the server, say:"malformed header from script. Bad header=TRAINLM, Epoch 0/300, MSE 0.80: matweb.exe, referer: <http://127.0.0.1/webserver/wsdemos/curve.html>." which is the first step train the network. I know the information: trainlm, epoch 0/300, mse 0.80 ... is automatical...

training matlab neural network
hi everyone I want to train a power flow neural network using PSS/E data .I got large amount of data. SO my questions are which is better; syntax method or the GUI method? and what determines the size because I have 5 inputs and 7 outputs? thanks Nelson ...

Result vector of neural network
Hi, As far as I know, when a neural network (e.g. multilayer, backprop) is applied for classification, the output neuron with the highest excitation is chosen as result. What about taking the highest X excitations and try to classify? For example: 3 different classifications are performed. The four highest outputs of each classification run are displayed below (a-c) Output a = [ 1 3 4 5] --> 1 Output b = [ 1 7 16 9] Output c = [3 1 4 5] For some reason we know that Output a is correct. The question is if b and c return the correct result. If one looks at output b and c one would probabl...

MATLAB Neural network question
How can I repeat the ANN training and I guarantee getting the same answer. I am trying to perform ANN sensitivity analysis for some ANN parameters. The problem I am facing is that every time I train the network, even for the same exact set of parameters, I get different results and this is mainly due to some randomization. In MATLAB, I try to fix the "seed" number, but even this does not work. Any idea AA wrote: > How can I repeat the ANN training and I guarantee getting the same answer. > I am trying to perform ANN sensitivity analysis for some ANN parameters. >...

Neural Network Result for Furture
Hi, everybody I have a basic problem about the Neural Network tools of Matlab. When I finished the train of network use net = newrb(P,T,0.02,1); How can I save this result and reuse this network for furture forecaseing(This network is create for forecasting somethings). So my questing is How do I save the resule? How do I reuse it in furture? Thanks a lot. Angler Chiang ...

neural network training in matlab
hi,i am doing a project on speaker recognition using artificial neural network.could anyone share information regarding the training of a neural network and how to initialize the weights ...

Matlab Neural Network Help
I have trained a neural network on MatLab and I need to use that network in the other program in Matlab. I have imported the trained neural network in the other program but now I am struggling to use that trained neural network to get the prediction/classification results on unknown dataset. Could you please some one guide me how I can use that trained network for getting results on unknown data..?? Or which function I can use to pass the unknown data through my trained network. Looking for your kind help...!!! On Oct 27, 9:56=A0am, "Niraj bende" <nirajbe...@gmail.com> wrote: ...

Neural Network in Matlab
Hi, i constructed the AND operations in a mutlilayer perceptron using the following codes, a graph is plotted based on the num of epochs after training the data sets. During training, how can i display or print out each iteration of the inputs, errors, weights in matlab for the first 10 iterations? for AND MLP: with 2 hidden neurons and one output, weights are generated randomly. P = [0 0 1 1; 0 1 0 1]; T = [0 0 0 1]; net = newff(minmax(P),[2 1],{'tansig' 'logsig'},'trainlm'); net.trainParam.epochs = 100; net = train(net,P,T); output = sim(net,P); d...

Matlab neural network in C++ ?
David Solinger (davidsol@xs4all.nl) wrote: "Is it somehow possible to use a trained neural network from Matlab in a C++ application? For example by means of a dll file." Assuming that one had the discovered parameters (weight matrices, typically) and the architecture of the neural network, it would be fairly easy to construct a routine to fire the neural network in C++. -Will Dwinnell http://will.dwinnell.com of course and that's the roule of the matlab compiler using mex filles, i'm trying using it for the first time but i'v a lot difficulties "Will ...

Neural network implementation on matlab
Could someone please send me a complete matlab code for a neural network with several layers . I could not understand how to define the weight matrices and connection matrices. if it is with a small diagram i think it would be easy to understand. regards, cgs CGS Gunasekara wrote: > > > Could someone please send me a complete matlab code for a neural > network with several layers . I could not understand how to define > the > weight matrices and connection matrices. if it is with a small > diagram > i think it would be easy to understand. > > regards, > cgs > > hi you can search in mathworks 'Magnus Norgaard' and then find a good toolbox for Neural Network It is easy to understands regards gheibi CGS Gunasekara wrote: > > > Could someone please send me a complete matlab code for a neural > network with several layers . I could not understand how to define > the > weight matrices and connection matrices. if it is with a small > diagram > i think it would be easy to understand. > > regards, > cgs i will give my code for nn multilayer backpropagation, but you must help me, give me neural network code for using in S-function from simulink, ok? if you know S-function code for NN-BP in simulink, contac me thanks in advance A full I-H-O feedforward network topology is defined by net = newff(minmax(P),[H O],{'tansig' 'purelin'}); where size(P) = [I Ntr] Ntr = number of cases i...

Matlab neural network toolbox
Hello, Anyone out there have personal experience with the neural net module for Matlab? I'd appreciate hearing about your experience, since I'm considering the purchase of Matlab and the NN package. On 29 Jan 2004 10:06:38 -0800, cook_jim@yahoo.com (J Cook) wrote: >Hello, > >Anyone out there have personal experience with the neural net module >for Matlab? I'd appreciate hearing about your experience, since I'm >considering the purchase of Matlab and the NN package. I've just starting using it and was able to get up and running very quickly. There&#...

Neural network in matlab #2
Hi please any one can guide me the method to fix the desired value when we are going to train ANN with backpropogation method or is there any method to selection desired value on the basis of train data ? Thanks "Babar Zaman " <ravian1011@yahoo.com> wrote in message <klqliq$ndl$1@newscl01ah.mathworks.com>... > Hi please any one can guide me the method to fix the desired value when we are going to train ANN with backpropogation method or is there any method to selection desired value on the basis of train data ? > Thanks Hi Babar, as a neural network trai...

neural network in matlab #3
Hi, How can I generate the code of nntool when I finish the neural network? I used : Input, Target and Sample. Can I make this??? Thank's Andrew ...

Matlab Neural network / Engines
hi, (Kindly go through patiently) i am using matlab engine in fortran to train the network. The main 'F1' prog calls the subroutine 'FM' to train the network. After training i just want to use this "FM' subroutine for evaluation of Neural network, so for subsequent call to 'FM' from other subroutine it shud only do evaluation process rather than training each time when it is called. It is important to state that i am able to train & coming out of 'FM' with out closing matlab and it is gving the output each time when input is passed from ...

Web resources about - how to decrease fluctuation in neural network results? - comp.soft-sys.matlab

Quantum fluctuation - Wikipedia, the free encyclopedia
That means that conservation of energy can appear to be violated, but only for small values of t (time). This allows the creation of particle- ...

Recent economic fluctuations in Iran - YouTube
In the last two weeks, Iran's capital market has seen some huge but hopeful changes. The Iranian Currency, the Rial, has had an appreciation ...

China steels itself against iron fluctuations
Chinese steel mills dominate iron ore derivatives market to hedge themselves against volatility.

More wild weather fluctuations on the way for Victoria
Showers, possible thunderstorms and a plummeting temperature won't hit city until after peak-hour.

Air Canada posts record 2014 results despite Q4 loss from currency fluctuations
Air Canada says it posted the best annual financial results in its 77-year history in 2014, which the airline's chief executive described as ...

China not distracted by short-term fluctuations: Premier
China not distracted by short-term fluctuations: Premier People's Daily Online TIANJIN, Sept. 10 Chinese Premier Li Keqiang on Wednesday said ...

RMB slump worries overblown, two-way fluctuation expected
RMB slump worries overblown, two-way fluctuation expected

App Store app prices going up in Canada, New Zealand and 5 more countries due to exchange rate fluctuations ...
... at 9to5Mac . What do you think? Discuss "App Store app prices going up in Canada, New Zealand and 5 more countries due to exchange rate fluctuations" ...

Apple suspends online store operation in Russia due to ruble fluctuations
Apple has taken down its online store and ceased online sales in Russia in response to extreme fluctuations in the ruble. As reported by Bloomberg ...

Quantum fluctuations may uncover a clue to high-temperature superconductivity
... et al. found evidence of a quantum critical point (QCP): a place where the material's properties change radically due to quantum fluctuations ...

Resources last updated: 3/7/2016 2:15:06 PM