PDA

View Full Version : Tips in writing Custom Neural Network (Generalized Regression NN)?



pjmendes
05-14-2009, 09:59 AM
First of all, greetings to all in this forum. I've recently started using Weka and i find it a great, user friendly tool.

I am interested in implementing a Generalized Regression Neural Network (based on Specht's 1991 paper) class in Java code, and I believe it's quite feasible using Weka's existing data structures. However, i'd like to hear some tips on which structures to use, which classes to inherit from, or pointers to similiar existing work or site where this has been done before (implementing a custom neural network).

I realize one can use PMML's to use a previously created GRNN model, but i need to create and train a new GRNN.

I'd be more than willing to share the result of the implementation with the Weka project, of course :)

Thank you in advance.

Mark
05-15-2009, 12:33 AM
Hi,

Take a look at the articles on writing your own classifier, filter etc. linked to from the FAQ in the Weka Wiki:

http://weka.wiki.sourceforge.net/Frequently+Asked+Questions#tocFrequently%20Asked%20Questions35

Also take a look at the "Weka Classification Algorithms Project." It has a number of evolutionary methods implemented using Weka:

http://wekaclassalgos.sourceforge.net/

Cheers,
Mark.

pjmendes
05-15-2009, 10:06 AM
Thank you for pointing me in the general direction. I'll post back when i have some work done.

pjmendes
07-24-2009, 09:46 AM
Greetings all,
I've implemented a GRNN solution for Weka. I'm now interested in validating it through testing. Having ran some tests on toy examples, i'd be interested in hearing your thoughts on testing and validating a neural network implementation, ways to specifically validate a GRNN, or Weka unit testing guidelines.

Thank you in advance.

Mark
07-26-2009, 06:03 PM
Hi pjmendes,

This sounds really cool! I don't really have any advice specific to testing neural nets as such, but there are some general things you can do. Here's what I'd do:

1) Download a set of benchmark regression data sets. There are two commonly used numeric class benchmark data set collections available from the Weka web site (datasets-numeric.jar and regression-datasets.jar):

http://www.cs.waikato.ac.nz/ml/weka/index_datasets.html

2) Use the Experimenter (10x10 or 5x10 fold CV) to run your implementation over all these datasets. This often will reveal any pathological problems/bugs.

3) Run other Weka regression schemes to see how your method compares and to see if there are any datasets where you do much better or much worse (both could indicate some problem somewhere). Try comparing to standard least squares regression, model trees (weka.classifiers.trees.M5P) and perhaps support vector machines for regression. Also, are there some sensible defaults for any parameters to your method that give reasonable results in general? (e.g. Weka's multilayer perceptron has a heuristic to set the number nodes in the hidden layer based on the number of input attributes).

4) Write a unit test for your method. Weka's testing framework has built-in support for regression testing, so this is fairly trivial and involves just extending an abstract base test class. You can add as many further specific tests for you method as you like. The testing stuff is included in your distribution or from subversion. Take a look in src/test/java/weka

Hope this helps.

Cheers,
Mark.

pjmendes
07-26-2009, 10:03 PM
Thanks for the long and thorough reply, Mark, and for the great advice! I'll make sure to apply those steps in testing.
I'll have the code available as soon as possible, it's been developed under a university's research fund and i still have to come to an agreement with my supervisor in order to publish the code, but it should happen soon.

iferreira
01-19-2010, 09:19 AM
Hi pjmendes,

I am interested in using GRNN to model design decisions such as choosing a launcher for a space mission. I developed a code to do it with a simple multilayer perceptron network but would like to compare it with a GRNN.
Do you already know if you can make the code publicaly available?

Cheers,

Ivo Ferreira

pjmendes
01-21-2010, 01:15 PM
Greetings Ivo,
My implementation of the GRNN runs somewhat slowly as the number of training instances increase, due to heavy number of casts done in java (since each of the nodes for each layer implements a NeuralMethodGR, and there is large number of casts, which slows the code down). Also, the code hasn't yet been cleaned up, it's a bit messy.
I've reimplemented it without using Weka's class structure, using simpler structures (although less Object Oriented), and made it run at a faster speed.
I will question my supervisor to find if I may share it, and reply soon.

lmsasu
10-03-2011, 10:13 AM
Greetings all,
I've implemented a GRNN solution for Weka. I'm now interested in validating it through testing. Having ran some tests on toy examples, i'd be interested in hearing your thoughts on testing and validating a neural network implementation, ways to specifically validate a GRNN, or Weka unit testing guidelines.

Thank you in advance.

Hello pjmendes,

Is the extension package with GRNN publicly available?

pjmendes
10-03-2011, 11:01 AM
Hi lmsasu,

I never got to fully integrate my GRNN implementation into Weka. The final code I have may be a mess and I can't ensure that it works :( (I didn't fully understand how to simulate some important features at the time, such as multidimensional input, and created new functions instead of overriding the ones Weka uses - some hacking was involved).

Afterwards I implemented a second solution in Java that didn't use Weka, using simpler design and code.

In the following attachment you can find both. I hope they can be of use to you.

7842