public class SOMTrainer extends Trainer
| Modifier and Type | Field and Description |
|---|---|
protected double |
deltaRadius
The change of radius per epoch.
|
protected double |
radius
The current neighborhood radius.
|
protected double |
startRadius
The initial neighborhood radius.
|
protected Topology |
topology
The topology of the SOM.
|
currentEpoch, epochs, learnRate, net, shuffle, stepMode, testData, trainingData, trainingSignalGenerator| Constructor and Description |
|---|
SOMTrainer(Topology topology)
Creates the SOM Trainer.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
calcAdaptation(BrainPart part)
Not used.
|
SOMTrainer |
clone()
A deep clone.
|
protected void |
endBatch()
Decreases the neighborhood radius.
|
protected void |
endTrain()
Labels the neurons with cluster names.
|
void |
fromXML(org.jdom2.Element element)
Reads attributes from XML.
|
double |
getStartRadius() |
Topology |
getTopology()
Returns the topology of the SOM to be trained.
|
protected void |
reset()
Resets the neighborhood radius to the initial one, and sets the linear radius change such that
after all epochs the radius is 1.0.
|
void |
setNetwork(NeuralNet net)
Sets the network for trainer and topology.
|
void |
setStartRadius(double startRadius) |
double |
test()
Returns the error on the programs pattern set by comparing the cluster of the winning neuron
to the cluster of the pattern.
|
org.jdom2.Element |
toXML(org.jdom2.Element element)
Writes specific attributes to XML tree.
|
protected void |
train(java.util.List<java.lang.Double> inputPattern,
java.util.List<java.lang.Double> targetPattern)
Trains a single pattern once.
|
protected void |
train(Neuron neuron,
java.util.List<java.lang.Double> inputPattern,
double learnRate)
Updates the weights from all input neurons to the given map neuron and normalizes the new weights.
|
getBatchSize, getEpochs, getLearnRate, getNetwork, getRank, getTestData, getTrainingData, getTrainingSignalGenerator, getWinningNeuron, setBatchSize, setEpochs, setLearnRate, setShuffle, setStepMode, setTestData, setTrainingData, setTrainingSignalGenerator, test, toString, train, trainPattern, updateLinks, updateNeuronsprotected Topology topology
protected double startRadius
protected double radius
protected double deltaRadius
public SOMTrainer(Topology topology)
topology - the SOM topologypublic SOMTrainer clone()
protected void reset()
public void setNetwork(NeuralNet net)
setNetwork in class Trainernet - a neural netpublic Topology getTopology()
public double getStartRadius()
public void setStartRadius(double startRadius)
protected void train(java.util.List<java.lang.Double> inputPattern,
java.util.List<java.lang.Double> targetPattern)
protected double calcAdaptation(BrainPart part)
calcAdaptation in class Trainerpart - the brain part to be adaptedprotected void endBatch()
protected void endTrain()
public double test()
public org.jdom2.Element toXML(org.jdom2.Element element)
public void fromXML(org.jdom2.Element element)
protected void train(Neuron neuron, java.util.List<java.lang.Double> inputPattern, double learnRate)
neuron - a map neuroninputPattern - a patternlearnRate - the learn rate