Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Benchmarking and Comparing Encog, Neuroph and JOONE Neural Networks

, 3 Jun 2010
I compare the performance of Encog, Neuroph and JOONE
BenchmarkNN.zip
benchmark
encog-core-2.4.0.jar
joone-engine.jar
neuroph.jar
slf4j-api-1.5.6.jar
slf4j-jdk14-1.5.6.jar
import java.util.Vector;

import org.neuroph.core.learning.SupervisedTrainingElement;
import org.neuroph.core.learning.TrainingSet;
import org.neuroph.nnet.MultiLayerPerceptron;
import org.neuroph.nnet.learning.MomentumBackpropagation;

public class BenchmarkNeuroph implements Benchmarkable {

	private MultiLayerPerceptron network;
	private TrainingSet trainingSet;
	private MomentumBackpropagation train;

	@Override
	public void prepareBenchmark(double[][] input, double[][] ideal) {

		this.network = new MultiLayerPerceptron(
				input[0].length,
				Benchmark.HIDDEN_COUNT,
				ideal[0].length);
		this.trainingSet = new TrainingSet();

		for(int i=0;i<input.length;i++)
		{
			SupervisedTrainingElement element = new SupervisedTrainingElement(input[i],ideal[i]);
			trainingSet.addElement(element);
		}

		this.train = new MomentumBackpropagation(network);
		train.setTrainingSet(trainingSet);
		train.setMaxIterations(Benchmark.ITERATIONS);
		train.setLearningRate(Benchmark.LEARNING_RATE);
		train.setMomentum(Benchmark.MOMENTUM);
		train.setMaxError(Double.MIN_VALUE);
		train.setMinErrorChange(Double.MIN_VALUE);
	}

	@Override
	public double benchmark(int iterations) {
		train.setMaxIterations(iterations);
		train.run();
		return train.getTotalNetworkError().doubleValue();
	}
}

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)

About the Author

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

| Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 3 Jun 2010
Article Copyright 2010 by taheretaheri
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid