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 206976 articles. 0 followers. lunamoonmoon (258) is leader. Post Follow

0 Replies
137 Views

Similar Articles

[PageSpeed] 3
Reply:
Similar Artilces:

i have a question about using Time-Delay Neural Network
i have 8 different input factors, each one is time series. when i use newdtdnn , what sohould i do with the input delay vectors. Each dataset at least has 60 datapoints.For example, the input data is 8 different factors with 60datapooints,the target is 1 input factor. Input and target is at time t,and i want to predict at time t+1,t+2,t+3.But i don't know how to build Delay vactor.i use matlab (r2007a) neural network toolbox :Distributed Time-Delay Neural Network. SO, if anyone konws how to Build Delay vactor , please let me know. Thanks anyway. ...

WTB: Nortel Networks, Alcatel, Cisco, Juniper Networks, Enterasys / Cabletron, Extreme Networks, Foundry Networks, 3Com, Lucent, Marconi / Fore, Riverstone Networks, and others.
WTB: Nortel Networks, Alcatel, Cisco, Juniper Networks, Enterasys / Cabletron, Extreme Networks, Foundry Networks, 3Com, Lucent, Marconi / Fore, Riverstone Networks, and others. We buy the above networking hardware. Email netbuy@bellsouth.net with what you have. We may have interest in buying it. SAY YOU SAW IT IN THE NEWSGROUP! ...

Networking
I am a Developer (Oracle/Web) / Analyst with more of seventeen years of experience including the retail, healthcare, distribution and financial services industries. Area of expertise include in-depth knowledge of a variety of Oracle and Web developmental tools as well as UNIX on both mainframe and client server platforms. I am looking for a Developer (Oracle/Web) / Analyst position within twenty-five mile radius of where I live Limerick, Pa which includes the 422/202 corridors and Phila, Allentown and Bethlehem Pa. "jperson" <jegreene@erols.com> schrieb im Newsbeitra...

testing a code that runs in multiple processess and communicates via network
HelloHow to set-up automated test-bench of repeatable tests?In the tests: process #1 talks to process#2 via TCP/IP ; and we need tosomehow check whether the communication is successful. By "successful" imean: process#2 understood correctly (this would mean that, most likely,code for both sending and receiving is working OK).Where by "process" i mean operating system's process (task).------Longer version of my question ( in case the above version is unclear ordidn't provide enough details ) :What are the "best practices" and tools when it comes to testing J...

NadaPong: a graphic demo of Apple II network gaming
I finally got NADA.PONG on my website... In addition to the program and documentation, I have, for the first time, included a video of the demo! (Wow, video is *large*. Maybe I should try an MPEG-4 encoder. ;-) This should help to show how easy it is to use NadaNet to do some pretty interesting things. ;-) -michael NadaNet file server for Apple II computers! Home page: http://members.aol.com/MJMahon/ "The wastebasket is our most important design tool--and it's seriously underused." In article <l6udnY9zIb_BBVPbnZ2dnUVZ_rOpnZ2d@comcast.com>, "Michael J. Mahon...

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...

nlfilter with a function handle of vector-returning result
Hi, According the Help of nlfilter, it saids: "B = nlfilter(A, [m n], fun) applies the function fun to each m-by-n sliding block of the grayscale image A. fun is a function that accepts an m-by-n matrix as input and returns a scalar result." ^^^^^^^^^ fun must return a scalar result. What if I have a row vector of six elements such as following: for ib=1:4 fhandle=@statxture; % output six texture measures t = nlfilter(X(:,:,ib),[3 3],fhandle); % X has red, gre, blu and one more band end It shows that a dialog saying "Applying neighborhoo...

Lexmark Network printing difficulties
Hello, I'm having trouble getting a Lexmark z52 printer to print over a network. The printer is physically connected to my new server (school computer lab) using a parallel cable. There are 2 lexmark z52 printers connected and a hp deskjet 670c. I have 3 parallel ports in the server. The server is running Windows server 2003 and the clients are using windows 98. The printers work fine when printing a test page from the server itself and the hp deskjet prints fine from both the server and the clients so I presume it is a problem with the lexmark driver configuration. (this is my...

Networking or Temporal Logic in Prolog
hey, has anyone heard of a networked application in prolog where queries ca= n be true for one node and false for others. it would imply a multiple use= r scenario where the user performing the query is different than the constr= uctor of the backlog, appropriately different for each of several nodes. a= lso, a temporal application that is true at one time and not true at others= ? What about cookies? They are intrinsically user-specific (e.g., session cookie) and can be made temporary by setting the "Expires" field. I think specification of expiration date is curren...

networking my ibook
I would to access my cousins network when I go to his house but, he has xp. Is there any way I can he can share some if his files with me. I'm running os9. Please help! "Edgar Tineo" <plasmo64@earthlink.net> wrote in message news:qVFQb.23649$i4.12158@newsread1.news.atl.earthlink.net... > I would to access my cousins network when I go to his house but, he has xp. > Is there any way I can he can share some if his files with me. I'm running > os9. Please help! -- The OS-9 that this newsgroup is about is Microware's OS-9 embedded real-time...

decrease the line
Hi Folks, After analyzing the line, it must be useful to describe the outsourcing of the color with great confidence; We may also notice that, it should be helpful to describe the flow control of the color using centers of excellence prior to the debate about the line or the color monitoring; why do you describe the line pretreatment? After analyzing the line , maybe this link might be of use: http://www.mynewsreader.com/20800/color%2Bline/ http://www.mail-archive.com/bug-coreutils%40gnu.org/msg05145.html http://www.cwc-i.com/artist/tomoto/ http://ctanhg.scharrer-online.de/hg/b...

120012-14
Hi. I have problem with 120012-14 and consequently with possible upgrade to 08/07 (u4). I had to patchrm 120012-14 back to 125101-10 because my nge(7d) stopped working. Last working nge driver on my machine with nForce4 KN8 SLI chipset is v1.2. All later patches are causing dead interface - plumbed, up and running, but packages doesn't leave or enter in and out of my system. Kernel logs are not reporting any errors. Kernel thinks it has 100 full duplex and notices if I pull in/out ethernet cable, but that's all. Tried power on/off, ndd duplex, speed adv_* settings, 32-bit mode ... n...

Re: Neural Network classification problems
i am very surprised by your experience. given enough number of hidden units (neuros), nnet with only 1 hidden layer is supposed to be an universal approximator. based on what you described, your nnet seems to have way too many parameters, which could be a double-edge sword to some extent. there are several ways to improve the training of nnet. 1) scale inputs to help convergence 2) multiple random starting points for training to reduce the chance of trapping into local minimum, which is by no means evitable. 3) model averaging of multiple nets trained by random sample of original dataset. the ...

updates across a Samba network
im running a samba network with windows 2000 clients on it. Im wondering if anyone knows of a way to send updates/patches (i.e. win2k patches/virus updates)across it without using any third party software (other than maybe linux). If anyone has any good ideas of possible scripts that are of use i would be grateful ...

Browsing _my_ network shares using _my_ computer fails without network connection...
Hello, My computer is called \\torarvid in network neighbourhood. When pointing windows explorer to "\\torarvid" from that computer, I will get a listing of my network shares, and am normally able to browse them. However, if I disconnect my network cable, this will not work, even though it is the local machine... I feel it should not require a network connection to be able to do this... Do I have something set up wrong, or is it just the way it is...? ...

Warning: MATLAB is starting in a directory where the .bi file for 'eval' is not visible. This may result in a performance degradation
Hi everyone I helped my friend install his Matlab, after run it ,i got: Warning: MATLAB is starting in a directory where the .bi file for 'eval' is not visible. This may result in a performance degradation The system configuration is: XP Intel CPU Ram:2G I&#12288;never encountered this before, i also googled it, still cannot find valuable information. Any suggestions? Thanks in advance. The question in Chinese is: http://www.iLoveMatlab.cn/thread-16249-1-1.html ...

comp.ai.neural-nets FAQ: weekly reminder #55
This is a reminder for the existence of seven monthly postings to the Usenet newsgroup comp.ai.neural-nets. The postings are called: comp.ai.neural-nets FAQ, Part 1 of 7: Introduction comp.ai.neural-nets FAQ, Part 2 of 7: Learning comp.ai.neural-nets FAQ, Part 3 of 7: Generalization comp.ai.neural-nets FAQ, Part 4 of 7: Books, data, etc. comp.ai.neural-nets FAQ, Part 5 of 7: Free software comp.ai.neural-nets FAQ, Part 6 of 7: Commercial software comp.ai.neural-nets FAQ, Part 7 of 7: Hardware and miscellaneous FAQ stands for 'Frequently Asked Questions'. Its purpo...

Newbie in neural networks
Hi, cud Nybody pls help me out for following problem. I want to simulate one system which is having 12 inputs and 8 outputs and all inputs are not linearly related with output. please suggest me which model is most appropriate for this application and if anybody can give me link of the same type of example it wud be gr8 help for me. thanks vinni wrote: > > > Hi, > cud Nybody pls help me out for following problem. > I want to simulate one system which is having 12 inputs and 8 > outputs > and all inputs are not linearly related with output. please suggest > me >...

Two network cards, module mess
A server I am working with has two NICs : 0000:02:01.0 Ethernet controller: Intel Corp. 82545GM Gigabit Ethernet Controller (rev 04) and 0000:05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express (rev 01) My /etc/modutils/aliases (yes, I ran update-modules) contains : alias eth0 tg3 The ethernet cable is plugged into the Broadcom NIC above. However, when I boot up the machine, eth0 gets assigned to the Intel NIC and module e1000 gets loaded. Module tg3 also gets loaded. The result is that the network connected goes down. Is this because of...

Stats comp.os.linux.networking (last 7 days) #141
Stats comp.os.linux.networking (last 7 days) Top 10 posters for the period: rank posts kbytes name address 1 7 16.6 Tauno Voipio tauno.voipio@INVALIDiki.f 2 6 17.2 Moe Trin ibuprofin@painkiller.exam 3 6 15.8 Allen McIntosh nospam@mouse-potato.com 4 5 15.4 king king@localhost.home.net 5 5 14.0 Unruh unruh-spam@physics.ubc.ca 6 4 11.2 Douglas Mayne doug@localhost.localnet 7 4 10.8 mikepro@gmail.com mikepro@gmail.com ...

CE Networking Slow
Hi, I have a device running windows CE .NET 4.10. I also have a wireless network which I can browse from my device although the first time I try to browse it takes a few minutes. After the first time it responds immediately as if it remembers the ip resolution or something. Is there any way to stop this initial delay? Any help greatly appreciated. I know it doesn't directly answer your question, I'm afraid I can't help you with it. However I know that there are vast improvments in the wireless stack in CE 4.2. Is there by any chance a ROM upgrade to 4.2 from your OEM? -- C...

Network based media server for home automation?
Is there any software (ideally software but I will look at a hardware solution) out there that allows you to set up a networked media server that can be controlled by RS-232 to pump audio and/or video to multiple locations in the house? I want to output all audio/video from the back of the PC and route it through my whole house audio/video system. I need RS-232 to control it from my home automation system. http://www.elanhomesystems.com/product/control/sseries/s12.asp http://www.microsoft.com/windowsxp/mediacenter/default.mspx http://exceptionalinnovation.com/ "Simon" <junk...

network printer probs
on a small lan i have win2k and xp pro systems i have a printer on a 2k machine shared my problem is that all the 2k machines can connect to this printer but none of the xp pro machines can any help would be appreciated thanks ...

Main costs invloved in Network Security
Hi What is the main cost for introducing and enhancing out network security? Thanx steven_82m@hotmail.com (Linux Man) writes: > Hi > > What is the main cost for introducing and enhancing out network > security? Doing homework for college students who don't disclose that they're posting for homework help on security forums is one slice. The main cost is likely the labor cost of the skilled manpowre needed to stay on top of things like configuring devices, firewall rules, implementing and staying on top of IDS solutions, being able to respond to potential denial of ser...

Using a Neural Net to Identify Sensitive Data
I haven't touched neural nets in 10 years, and was wondering if it was feasable to use a net to identify sensitive data. By training the net on known sensitive data then using it to identify other sensitive data. TIA Dear Nicolas, please be more specific. What exactly are you trying to do? Are you trying to classify the data? Are you trying to identify patterns in the data ( clustering etc )? Are you actually trying to fit a model of a generating process to your data ( is this what you mean by identifying ? )? What exactly are you trying to do? I doubt that anyone can provide you wit...