Package libai.nn.unsupervised
Class UnsupervisedLearning
- java.lang.Object
-
- libai.nn.NeuralNetwork
-
- libai.nn.unsupervised.UnsupervisedLearning
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
Competitive,Hopfield,Kohonen
public abstract class UnsupervisedLearning extends NeuralNetwork
Created by kronenthaler on 19/03/2017.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class libai.nn.NeuralNetwork
plotter, progress, random
-
-
Constructor Summary
Constructors Constructor Description UnsupervisedLearning()UnsupervisedLearning(java.util.Random rand)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidtrain(Column[] patterns, double alpha, int epochs, int offset, int length)Trains this neural network with the list ofpatternsand the expectedanswers.voidtrain(Column[] patterns, Column[] answers, double alpha, int epochs, int offset, int length, double minerror)Trains this neural network with the list ofpatternsand the expectedanswers.protected voidvalidatePreconditions(Column[] patterns, int epochs, int offset, int length)-
Methods inherited from class libai.nn.NeuralNetwork
error, error, euclideanDistance2, euclideanDistance2, gaussian, getDefaultRandomGenerator, getPlotter, getProgressBar, initializeProgressBar, open, open, open, save, setPlotter, setProgressBar, simulate, simulate, train, train
-
-
-
-
Method Detail
-
train
public abstract void train(Column[] patterns, double alpha, int epochs, int offset, int length)
Trains this neural network with the list ofpatternsand the expectedanswers.Use the learning rate
alphafor manyepochs. Takelengthpatterns from the positionoffset.patternsmust be array of non-nullcolumn matrices- Parameters:
patterns- The patterns to be learned.alpha- The learning rate.epochs- The maximum number of iterationsoffset- The first pattern positionlength- How many patterns will be used.
-
train
public void train(Column[] patterns, Column[] answers, double alpha, int epochs, int offset, int length, double minerror)
Description copied from class:NeuralNetworkTrains this neural network with the list ofpatternsand the expectedanswers.Use the learning rate
alphafor manyepochs. Takelengthpatterns from the positionoffsetuntil theminerroris reached.patternsandanswersmust be arrays of non-nullcolumn matrices- Specified by:
trainin classNeuralNetwork- 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.
-
validatePreconditions
protected void validatePreconditions(Column[] patterns, int epochs, int offset, int length)
-
-