Java Adaptive Resonance Theory (ART1)
Adaptive Resonance Theory (ART) is a form of neural network developed by Stephen Grossberg and Gail Carpenter. There are several versions of the ART neural network, which are numbered ART-1, ART-2 and ART-3. The ART neural network is trained using either a supervised or unsupervised learning algorithm, depending on the version of ART being used. ART neural networks are used for pattern recognition and prediction.
The ART1 network modeled in the Encog Workbench looks like this:
The above diagram would produce the following Java code.
BasicNetwork network = new BasicNetwork();
Layer inputLayer = new BasicLayer( new ActivationLinear(),false,4);
inputLayer.addNext(inputLayer);
Layer outputLayer = new BasicLayer( new ActivationLinear(),false,8);
inputLayer.addNext(outputLayer);
outputLayer.addNext(inputLayer);
network.tagLayer("INPUT",inputLayer);
network.tagLayer("F1",inputLayer);
network.tagLayer("F2",outputLayer);
network.tagLayer("OUTPUT",outputLayer);
network.getStructure().finalizeStructure();
network.reset();Usually you will use an Encog pattern when you want to produce a common neural network type, such as ART1. The following example uses a pattern to create an ART1 network to classify patterns.
import org.encog.neural.data.bipolar.BiPolarNeuralData;
import org.encog.neural.networks.BasicNetwork;
import org.encog.neural.networks.logic.ART1Logic;
import org.encog.neural.pattern.ART1Pattern;
public class NeuralART1 {
public static final int INPUT_NEURONS = 5;
public static final int OUTPUT_NEURONS = 10;
public static final String[] PATTERN = {
" O ",
" O O",
" O",
" O O",
" O",
" O O",
" O",
" OO O",
" OO ",
" OO O",
" OO ",
"OOO ",
"OO ",
"O ",
"OO ",
"OOO ",
"OOOO ",
"OOOOO",
"O ",
" O ",
" O ",
" O ",
" O",
" O O",
" OO O",
" OO ",
"OOO ",
"OO ",
"OOOO ",
"OOOOO" };
private boolean[][] input;
public void setupInput()
{
this.input = new boolean[PATTERN.length][INPUT_NEURONS];
for (int n=0; nThe above example produces the following output.
O - 0
O O - 1
O - 1
O O - 2
O - 1
O O - 2
O - 1
OO O - 3
OO - 3
OO O - 4
OO - 3
OOO - 5
OO - 5
O - 5
OO - 6
OOO - 7
OOOO - 8
OOOOO - 9
O - 5
O - 3
O - 2
O - 0
O - 1
O O - 4
OO O - 9
OO - 7
OOO - 8
OO - 6
OOOO - new Input and all Classes exhausted
OOOOO - new Input and all Classes exhausted



