public abstract class KohonenSOMTrainer extends Object implements Serializable
KohonenSOMTrainer
is an abstract class with 2 abstract
methods, getNeighborhoodValue
and
getLearningCoefficient
. Therefore, a subclass
of KohonenSOMTrainer
needs to implement the
getNeighborhoodValue
and getLearningCoefficient
methods.
Constructor and Description |
---|
KohonenSOMTrainer() |
Modifier and Type | Method and Description |
---|---|
int |
getIterations()
Returns the number of iterations used for training.
|
abstract double |
getLearningCoefficient(int t)
Returns the learning coefficient.
|
abstract double |
getNeighborhoodValue(int t,
double d)
Returns the neighborhood function value.
|
int |
getNumberOfThreads()
Returns the number of
java.lang.Thread instances used for
parallel processing. |
void |
setIterations(int iterations)
Sets the number of iterations to be used for training.
|
void |
setNumberOfThreads(int numberOfThreads)
Sets the number of
java.lang.Thread instances to be used for
parallel processing. |
void |
train(KohonenSOM kohonen,
double[][] data)
Trains a Kohonen network.
|
public int getIterations()
int
scalar containing the number of iterations
used for training.public abstract double getLearningCoefficient(int t)
t
. Typical forms are linear, power, and inverse
time/step. For example:
power:
where t=t
, T=the number of iterations used for training,
= initial learning coefficient,
= final learning coefficient
inverse time:
where A and B are user determined constants
t
- An int
scalar containing the current iteration
of the training.double
scalar containing the computed learning
coefficient.public abstract double getNeighborhoodValue(int t, double d)
where r represents the neighborhood radius at index t
t
- An int
scalar containing the current iteration
of the training.d
- A double
scalar containing the lattice distance
between the best matching node and the
current node.double
scalar containing the computed
neighborhood function value.public int getNumberOfThreads()
java.lang.Thread
instances used for
parallel processing.int
containing the number of
java.lang.Thread
instances used for parallel processing.public void setIterations(int iterations)
iterations
- An int
scalar containing the number of
iterations to be used for training.
iterations
must be greater than zero.
Default: iterations
= 100.
public void setNumberOfThreads(int numberOfThreads)
java.lang.Thread
instances to be used for
parallel processing.numberOfThreads
- an int
specifying the number of
java.lang.Thread
instances to be used for parallel
processing.
Default: numberOfThreads
= 1.
public final void train(KohonenSOM kohonen, double[][] data)
kohonen
- A KohonenSOM
object to be trained.data
- A double
matrix containing the data to be used
for training the Kohonen network.
data[i].length
must be equal to
dim
, the number of weights for each node, in
kohonen
.Copyright © 1970-2015 Rogue Wave Software
Built October 13 2015.