|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.yccheok.SOM2D
public class SOM2D
A class for 2-Dimension Self-Organizing Map.
Constructor Summary | |
---|---|
SOM2D(int numOfInput,
int width,
int height)
Creates a new instance of SOM2D |
Method Summary | |
---|---|
java.awt.Point |
getBestMatchingUnit(SOMInput somInput)
Get the location of BMU for current SOM input. |
int |
getCurrentIteration()
Get the number of current iteration during the training. |
int |
getHeight()
Get the height of this SOM. |
double |
getLearningRate()
Get the learing rate which will be used in training. |
double |
getMapRadius()
Get the map radius based on the following equation : mapRadius = (double)(Math.max(width, height)) / 2.0 |
int |
getNumOfInput()
Get the number of input per neuron (weight). |
int |
getNumOfIteration()
Get the number of iteration which will be used in training. |
double |
getTimeConstant()
Get the time constant based on the following equation : timeConstant = (double)numOfIteration / Math.log(mapRadius) |
double |
getWeightValue(int x,
int y,
int index)
Get the value of index th weight at specified (x, y) location. |
int |
getWidth()
Get the width of this SOM. |
void |
init(int numOfIteration,
double learningRate,
double weightLowerBound,
double weightUpperBound)
Initialize the SOM before learning. |
void |
setLearningRate(double learningRate)
Set the learning rate which will be used in training. |
void |
setNumOfIteration(int numOfIteration)
Set the number of iteration which will be used in training. |
boolean |
train(SOMInput somInput)
Train the SOM to learn. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SOM2D(int numOfInput, int width, int height)
numOfInput
- Number of input per neuron (weight).width
- Width of this SOM.height
- Height of this SOM.Method Detail |
---|
public void setLearningRate(double learningRate)
public double getLearningRate()
public void setNumOfIteration(int numOfIteration)
public int getNumOfIteration()
public int getCurrentIteration()
public double getTimeConstant()
public double getMapRadius()
public int getWidth()
public int getHeight()
public int getNumOfInput()
public double getWeightValue(int x, int y, int index)
x
- X coordinate location.y
- Y coordinate location.index
- index th of the weight.
public void init(int numOfIteration, double learningRate, double weightLowerBound, double weightUpperBound)
numOfIteration
- Number of iteration which will be used in training.learningRate
- Learning rate.weightLowerBound
- A random value will be assigned to all the weights. This is
the lower bound of the random value (inclusive).weightUpperBound
- A random value will be assigned to all the weights. This is
the upper bound of the random value (exclusive).public boolean train(SOMInput somInput)
somInput
- An input to be pumped into SOM for learning purpose.
public java.awt.Point getBestMatchingUnit(SOMInput somInput)
somInput
- The input for SOM.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |