Elman Neural Network

mancer's picture

Is it possible to create an Elman (recurrent) neural network with Encog? Do you have an example of how it would be constructed?

jeffheaton's picture

Encog 2.0 supports recurrent nets. Here is an example of what the syntax looks like.


static BasicNetwork createElmanNetwork()
{
// construct an Elman type network
Layer hidden;
Layer context = new ContextLayer(2);
BasicNetwork network = new BasicNetwork();
network.addLayer(new BasicLayer(1));
network.addLayer(hidden = new BasicLayer(2));
hidden.addNext(context,SynapseType.OneToOne);
context.addNext(hidden);
network.addLayer(new BasicLayer(1));
network.getStructure().finalizeStructure();
network.reset();
return network;
}

It is still a few more months before we do an official Encog 2.0 release, though. However, this code is checked into SVN.


Copyright 2005 - 2012 by Heaton Research, Inc.. Heaton Research™ and Encog™ are trademarks of Heaton Research. Click here for copyright, license and trademark information.