Flash Website Builder- Trendy Site Builder is a Flash Site Building tool that helps users build stunning websites. Check Out Custom Custom Logo Design by LogoBee. Website Design and Free Logo Templates available.
 CodingForums.com Neural Network Code NullPointerException help

Before you post, read our: Rules & Posting Guidelines

Enjoy an ad free experience by logging in. Not a member yet? Register.
 05-11-2012, 10:53 PM PM User | #1 penumbra New to the CF scene   Join Date: May 2012 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts Neural Network Code NullPointerException help This is a long but basic question, no knowledge on neural networks is required. Posted a pic of me to offer an incentive. So I'm currently working on implementing a neural network. It should all work...but obviously it doesn't. The project has 3 classes -NeuralNetwork which is "where all the magic happens" -NeuralLayer which just keeps track of the nodes in a layer -NeuralNode which keeps track of a node's value, weights it's sending out, and bias (none of that is really important) just thought I'd point out that there are other classes. In the main I have among other things: Code: net.runAll(15); where 15 represents the number of times to run the network. Here's the runAll method Code: public void runAll(int numTimes) //number of iterations for running the network { initializeRandomWeights(); int count=0; trainingRate = .1; while (count < numTimes) { forward(); calcOutputDelta(); for (int L=layers.length-1; L>0; L--) { updateWeights(L-1); updateBias(L); calcLayerDelta(L-1); } count++; trainingRate *= .9999; } } the important thing to note is the initializeRandomWeights in the first line of the method which calls these two methods. Code: public void initializeRandomWeights() //set random weights and bias { NeuralLayer nextLayer; //layer of nodes recieving the weights double[] rWeights; //random weights double rBias; for (int L=0; L
 05-12-2012, 01:22 PM PM User | #2 neural_nut New to the CF scene   Join Date: May 2012 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts Hey! Firstly, apologies if my response is off the mark, I havent been coding in over ten years, your mail hit my radar becauseit contained the words neural and code. Two tips: 1) the variables being initialised in the functin initialiseall wont exist outside of that function. You either need to make the variables public static variables in the class or pass the initialisation results back out to the calling function and apply them to variables there. 2) giving the photo incentive with the question doesnt incentivise giving a response! Should be photo for answer :-) Hope thathelps NN PS. Sent from my eeePad so please excuse punctuation mistakes.

 Bookmarks

 Thread Tools Rate This Thread Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home :: Client side development     JavaScript programming         DOM and JSON scripting         Ajax and Design         JavaScript frameworks         Post a JavaScript     HTML & CSS     XML     Flash & ActionScript         Adobe Flex     Graphics and Multimedia discussions     General web building         Site reviews         Building for mobile devices :: Server side development     Apache configuration     Perl/ CGI     PHP         Post a PHP snippet     MySQL         Other Databases     Ruby & Ruby On Rails     ASP     ASP.NET     Java and JSP     Other server side languages/ issues         ColdFusion         Python :: Computing & Sciences     Computer Programming     Computer/PC discussions     Geek News and Humour Web Projects and Services Marketplace     Web Projects         Small projects (quick fixes and changes)         Medium projects (new script, new features, etc)         Large Projects (new web application, complex features etc)         Unknown sized projects (request quote)         Vacant job positions         Looking for work/ for hire         Project collaboration/ partnership         Paid work offers and requests (Now CLOSED)     Career, job, and business ideas or advice     Domains, Sites, and Designs for sale         Domains for sale         Websites for sale         Design templates and graphics for sale :: Other forums     Member Offers     Forum feedback and announcements

All times are GMT +1. The time now is 07:32 PM.