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 void
train(Column[] patterns, double alpha, int epochs, int offset, int length)
Trains this neural network with the list ofpatterns
and the expectedanswers
.void
train(Column[] patterns, Column[] answers, double alpha, int epochs, int offset, int length, double minerror)
Trains this neural network with the list ofpatterns
and the expectedanswers
.protected void
validatePreconditions(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 ofpatterns
and the expectedanswers
.Use the learning rate
alpha
for manyepochs
. Takelength
patterns from the positionoffset
.patterns
must be array of non-null
column 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:NeuralNetwork
Trains this neural network with the list ofpatterns
and the expectedanswers
.Use the learning rate
alpha
for manyepochs
. Takelength
patterns from the positionoffset
until theminerror
is reached.patterns
andanswers
must be arrays of non-null
column matrices- Specified by:
train
in 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)
-
-