|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.htwdd.rosenkoenig.neuro.net.NeuralNet
de.htwdd.rosenkoenig.neuro.net.KohonenNet
public class KohonenNet
KohonenNet is an implementation of a self organizing map. Use
KohonenTrainer to "unfold" the map.
A self organizing map is useful for e.g. image recognition. The map is able to divide a huge
number of inputs into different groups. Each group is represented by a "region" on the map.
Whenever an input vector is propagated, the self organizing map calculates a "winning neuron" by
determining the neuron whose weight vector has the lowest euclidic distance to the input vector.
The winning neuron is marked with an activation of 1.0. Depending on neighbourhood function (e.g.
Cone) and neighbourhood radius, some neurons in the surrounding of the winning neuron are also
activated.
More information on self organizing maps can be found
here.
| Field Summary | |
|---|---|
private double[] |
input
The input vector of the current run. |
private int |
inputLayerSize
The number of inputs provided to the map. |
private double[][] |
map
The output map of the current run. |
private NeighbourhoodFunction |
neighbourhoodFunction
|
private double[] |
output
The output map of the current run as a one dimensional array. |
private int |
outputHeight
The "height" of the Kohonen map. |
private int |
outputWidth
The "width" of the Kohonen map. |
private double[][][] |
weights
The weights of the Kohonen map. |
private int |
winnerX
The x-coordinate of the winning neuron. |
private int |
winnerY
The y-coordinate of the winnin neuron. |
| Constructor Summary | |
|---|---|
KohonenNet()
Creates a new uninitialized KohonenNet. |
|
KohonenNet(int inputSize,
int outputWidth,
int outputHeight,
java.lang.Class neighbourhoodFunction)
Creates and initializes a KohonenNet of the specified size. |
|
| Method Summary | |
|---|---|
org.jdom.Element |
createXml()
Creates an XML representation of the Kohonen map and its weights. |
void |
extractNet(org.jdom.Element xmlNet)
Extracts a Kohonen map from an XML element. |
double[] |
getInput()
Getter of the property input |
int |
getInputLayerSize()
Getter of the property inputLayerSize |
double[][] |
getMap()
Getter of the property map |
NeighbourhoodFunction |
getNeighbourhoodFunction()
Getter of the property neighbourhoodFunction |
double |
getNeighbourhoodRadius()
|
double[] |
getOutput()
Getter of the property output |
int |
getOutputHeight()
Getter of the property outputHeight |
int |
getOutputWidth()
Getter of the property outputWidth |
double[][][] |
getWeights()
Getter of the property weights |
int |
getWinnerX()
Getter of the property winnerX |
int |
getWinnerY()
Getter of the property winnerY |
private void |
initialize(java.lang.Class neighbourhoodFunction)
Initializes input vector, output vector and the map itself. |
void |
propagate(double[] pattern)
Calculates the winning neuron for the provided pattern. |
void |
setNeighbourhoodFunction(NeighbourhoodFunction neighbourhoodFunction)
Setter of the property neighbourhoodFunction |
void |
setNeighbourhoodRadius(double neighbourhoodRadius)
Sets the neighbourhood radius of the net's neighbourhood function. |
| Methods inherited from class de.htwdd.rosenkoenig.neuro.net.NeuralNet |
|---|
loadFromFile, saveToFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int inputLayerSize
private int outputWidth
private int outputHeight
private int winnerX
private int winnerY
private double[] input
private double[] output
private double[][] map
private double[][][] weights
private NeighbourhoodFunction neighbourhoodFunction
| Constructor Detail |
|---|
public KohonenNet()
public KohonenNet(int inputSize,
int outputWidth,
int outputHeight,
java.lang.Class neighbourhoodFunction)
inputSize - number of inputsoutputWidth - width of the mapoutputHeight - height of the mapneighbourhoodFunction - the neighbourhood function used for training and propagation| Method Detail |
|---|
private void initialize(java.lang.Class neighbourhoodFunction)
neighbourhoodFunction - public double[] getOutput()
getOutput in class NeuralNetpublic void propagate(double[] pattern)
propagate in class NeuralNetpattern - the pattern to propagatepublic void extractNet(org.jdom.Element xmlNet)
extractNet in class NeuralNetxmlNet - XML representation of the Kohonen mappublic org.jdom.Element createXml()
createXml in class NeuralNetpublic double getNeighbourhoodRadius()
public void setNeighbourhoodRadius(double neighbourhoodRadius)
neighbourhoodRadius - public NeighbourhoodFunction getNeighbourhoodFunction()
public void setNeighbourhoodFunction(NeighbourhoodFunction neighbourhoodFunction)
neighbourhoodFunction - The neighbourhoodFunction to set.public double[][] getMap()
public double[][][] getWeights()
public int getWinnerX()
public int getWinnerY()
public int getInputLayerSize()
public int getOutputWidth()
public int getOutputHeight()
public double[] getInput()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||