Package libai.nn.supervised
Class Adaline
- java.lang.Object
-
- libai.nn.NeuralNetwork
-
- libai.nn.supervised.SupervisedLearning
-
- libai.nn.supervised.Perceptron
-
- libai.nn.supervised.Adaline
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
RBF
public class Adaline extends Perceptron
Adaptative Linear neural network. Is a special case of the single layer Perceptron. Uses a identity as exit function. The only difference between the training algorithms is the 2*alpha multiplication. Because of this, the Adaline implementation is a subclass of Perceptron single layer.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class libai.nn.NeuralNetwork
plotter, progress, random
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
simulate(Column pattern, Column result)
Calculate the output for the pattern and left the result on result.void
train(Column[] patterns, Column[] answers, double alpha, int epochs, int offset, int length, double minerror)
Alias of super.train(patterns, answers, 2*alpha, epochs, offset, length, minerror);-
Methods inherited from class libai.nn.NeuralNetwork
error, error, euclideanDistance2, euclideanDistance2, gaussian, getDefaultRandomGenerator, getPlotter, getProgressBar, initializeProgressBar, open, open, open, save, setPlotter, setProgressBar, train, train
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class libai.nn.supervised.Perceptron
getWeights, simulate
-
Methods inherited from class libai.nn.supervised.SupervisedLearning
validatePreconditions
-
-
-
-
Constructor Detail
-
Adaline
public Adaline(int ins, int outs)
Constructor.- Parameters:
ins
- Number of inputs for the network = number of elements in the patterns.outs
- Number of outputs for the network.
-
Adaline
public Adaline(int ins, int outs, java.util.Random rand)
Constructor.- Parameters:
ins
- Number of inputs for the network = number of elements in the patterns.outs
- Number of outputs for the network.rand
- Random generator used for creating matrices
-
-
Method Detail
-
train
public void train(Column[] patterns, Column[] answers, double alpha, int epochs, int offset, int length, double minerror)
Alias of super.train(patterns, answers, 2*alpha, epochs, offset, length, minerror);- Overrides:
train
in classPerceptron
- Parameters:
patterns
- The patterns to be learned.answers
- The expected answers.alpha
- The learning rate.epochs
- The maximum number of iterationsoffset
- The first pattern positionlength
- How many patterns will be used.minerror
- The minimal error expected.
-
simulate
public void simulate(Column pattern, Column result)
Calculate the output for the pattern and left the result on result. result = W * pattern + b- Overrides:
simulate
in classPerceptron
- Parameters:
pattern
- The input patternresult
- The output result.
-
-