Click here to Skip to main content
15,886,873 members
Articles / Programming Languages / Java

Benchmarking and Comparing Encog, Neuroph and JOONE Neural Networks

Rate me:
Please Sign up or sign in to vote.
4.89/5 (8 votes)
3 Jun 2010LGPL38 min read 68.6K   971   14  
I compare the performance of Encog, Neuroph and JOONE

import org.encog.neural.data.NeuralData;
import org.encog.neural.data.basic.BasicNeuralData;

/**
 * Class used to generate random training sets.  This will always generate
 * the same number outputs, as it always uses the same seed values.  This
 * allows for the consistent results needed by the benchmark.
 */
public class GenerateData {

	private double[][] ideal;
	private double[][] input;

	private double randomRange(double min,double max)
	{
		double n = max - min + 1;
		double i = Math.random() % n;
		return  min + i;

	}

	public void generate(final int count, final int inputCount,
			final int idealCount, final double min, final double max) {

		this.input = new double[count][inputCount];
		this.ideal = new double[count][idealCount];

		for (int i = 0; i < count; i++) {

			for (int j = 0; j < inputCount; j++) {
				input[i][j] = randomRange(min,max);
			}

			for (int j = 0; j < idealCount; j++) {
				ideal[i][j] = randomRange(min, max);
			}
		}
	}

	public double[][] getInput() {
		return this.input;
	}

	public double[][] getIdeal() {
		return this.ideal;
	}

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Other Rutgers University
United States United States
Hello, I am a student at Rutgers University. I am in computer science and am learning about machine learning and AI.

Comments and Discussions