Click here to Skip to main content
13,289,653 members (54,014 online)
Click here to Skip to main content

Stats

51.2K views
890 downloads
14 bookmarked
Posted 3 Jun 2010

Benchmarking and Comparing Encog, Neuroph and JOONE Neural Networks

, 3 Jun 2010
I compare the performance of Encog, Neuroph and JOONE
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 org.encog.neural.activation.ActivationSigmoid;
import org.encog.neural.data.NeuralDataSet;
import org.encog.neural.data.basic.BasicNeuralDataSet;
import org.encog.neural.networks.BasicNetwork;
import org.encog.neural.networks.layers.BasicLayer;
import org.encog.neural.networks.logic.FeedforwardLogic;
import org.encog.neural.networks.training.Train;
import org.encog.neural.networks.training.propagation.back.Backpropagation;
import org.encog.util.logging.Logging;

public class BenchmarkEncog implements Benchmarkable {

	private BasicNetwork network;
	private NeuralDataSet trainingSet;
	private Backpropagation train;
	private int threadCount;

	public BenchmarkEncog(int threadCount)
	{
		this.threadCount = threadCount;
	}


	@Override
	public double benchmark(int iterations) {
		// train the neural network

		int epoch = 1;

		do {
			train.iteration();
			epoch++;
		} while (epoch <= Benchmark.ITERATIONS );

		return 0;
	}

	@Override
	public void prepareBenchmark(double[][] input, double[][] ideal) {
		// construct a network
		this.network = new BasicNetwork();
		network.addLayer(new BasicLayer(new ActivationSigmoid(),true,Benchmark.INPUT_COUNT));
		network.addLayer(new BasicLayer(new ActivationSigmoid(),true,Benchmark.HIDDEN_COUNT));
		network.addLayer(new BasicLayer(new ActivationSigmoid(),true,Benchmark.OUTPUT_COUNT));
		network.setLogic(new FeedforwardLogic());
		network.getStructure().finalizeStructure();
		network.reset();

		// construct training data
		this.trainingSet = new BasicNeuralDataSet(input, ideal);

		this.train = new Backpropagation(this.network, this.trainingSet,
				Benchmark.LEARNING_RATE, Benchmark.MOMENTUM);
		this.train.setNumThreads(this.threadCount);
	}
}

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)

Share

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.

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 3 Jun 2010
Article Copyright 2010 by taheretaheri
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid