kohonen
Class WTMLearningFunction

java.lang.Object
  extended by kohonen.WTMLearningFunction
Direct Known Subclasses:
WTMLearningFunctionWithTired

public class WTMLearningFunction
extends java.lang.Object

Winner Takes Most - algorytm where winnig neuron and neurons in neighboorhood weights are changed according to the formula w(k+1) = w(k) + n *N(i,x)* (x-w) where
w(k+1) - neuron weight in k +1 interation
w(k) - neruon weight for k iteration
n - value of learning function factor for k iteriation
N(i,x) - value of neighboorhood function for i - specified neuron x - learning vector od data w - neuron weight

See Also:
WTMLearningFunction

Field Summary
protected  LearningFactorFunctionalModel functionalModel
          reference to function model
protected  LearningDataModel learningData
          reference to learning data
protected  int maxIteration
          max number of iteration
protected  MetricModel metrics
          reference to metrics
protected  NeighbourhoodFunctionModel neighboorhoodFunction
          reference to neighboorhood function model
protected  NetworkModel networkModel
          reference to network model
protected  TopologyModel topology
          reference to topology model
 
Constructor Summary
WTMLearningFunction(NetworkModel networkModel, int maxIteration, MetricModel metrics, LearningDataModel learningData, LearningFactorFunctionalModel functionalModel, NeighbourhoodFunctionModel neighboorhoodFunction)
          Creates a new instance of WTMLearningFunction
 
Method Summary
protected  void changeNeuronWeight(int neuronNumber, double[] vector, int iteration, int distance)
          Change neuron weights for specified neuron number, iteration, input data vector and distance and distance to winning neuron
 void changeWeight(int neuronNumber, double[] vector, int iteration)
          Change specified neuron weight
protected  int getBestNeuron(double[] vector)
          Rerturn number of best neuron for specified input vector
 LearningFactorFunctionalModel getFunctionalModel()
          Return function model
 LearningDataModel getLearningData()
          Return reference to learning data
 int getMaxIteration()
          Return maximal number of iteration
 MetricModel getMetrics()
          Return metrics
 NeighbourhoodFunctionModel getNeighboorhoodFunction()
          Return reference to neighboorhood function
 NetworkModel getNetworkModel()
          Return network model
 boolean isShowComments()
          Return information if learning process dispalys information about learning process.
 void learn()
          Start learning process
 void setFunctionalModel(LearningFactorFunctionalModel functionalModel)
          Set functional learning factor model
 void setLearningData(LearningDataModel learningData)
          Set reference to learning data
 void setMaxIteration(int maxIteration)
          Set max interation
 void setMetrics(MetricModel metrics)
          Set metrics
 void setNeighboorhoodFunction(NeighbourhoodFunctionModel neighboorhoodFunction)
          Set reference to neighboorhood function
 void setNetworkModel(NetworkModel networkModel)
          Set network model
 void setShowComments(boolean showComments)
          Set if comments durring learning process must be shown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metrics

protected MetricModel metrics
reference to metrics


networkModel

protected NetworkModel networkModel
reference to network model


maxIteration

protected int maxIteration
max number of iteration


learningData

protected LearningDataModel learningData
reference to learning data


functionalModel

protected LearningFactorFunctionalModel functionalModel
reference to function model


topology

protected TopologyModel topology
reference to topology model


neighboorhoodFunction

protected NeighbourhoodFunctionModel neighboorhoodFunction
reference to neighboorhood function model

Constructor Detail

WTMLearningFunction

public WTMLearningFunction(NetworkModel networkModel,
                           int maxIteration,
                           MetricModel metrics,
                           LearningDataModel learningData,
                           LearningFactorFunctionalModel functionalModel,
                           NeighbourhoodFunctionModel neighboorhoodFunction)
Creates a new instance of WTMLearningFunction

Parameters:
networkModel - reference to network Model
maxIteration - max number of iteration
metrics - reference to metrics
learningData - reference to learning data
functionalModel - reference to functional Model
neighboorhoodFunction - reference to Neighboorhood Function
Method Detail

isShowComments

public boolean isShowComments()
Return information if learning process dispalys information about learning process.

Returns:
true if learning process display information

setShowComments

public void setShowComments(boolean showComments)
Set if comments durring learning process must be shown.

Parameters:
showComments - true if comments must be shown, false otherwise

setNeighboorhoodFunction

public void setNeighboorhoodFunction(NeighbourhoodFunctionModel neighboorhoodFunction)
Set reference to neighboorhood function

Parameters:
neighboorhoodFunction - reference to neighboorhood function

getNeighboorhoodFunction

public NeighbourhoodFunctionModel getNeighboorhoodFunction()
Return reference to neighboorhood function

Returns:
reference to neighboorhood function

getMetrics

public MetricModel getMetrics()
Return metrics

Returns:
metrics
See Also:
MetricModel

setMetrics

public void setMetrics(MetricModel metrics)
Set metrics

Parameters:
metrics - metrics

setNetworkModel

public void setNetworkModel(NetworkModel networkModel)
Set network model

Parameters:
networkModel - network model

getNetworkModel

public NetworkModel getNetworkModel()
Return network model

Returns:
network model

setMaxIteration

public void setMaxIteration(int maxIteration)
Set max interation

Parameters:
maxIteration - max interation

getMaxIteration

public int getMaxIteration()
Return maximal number of iteration

Returns:
maximal number of iteration

setLearningData

public void setLearningData(LearningDataModel learningData)
Set reference to learning data

Parameters:
learningData - reference to learning data

getLearningData

public LearningDataModel getLearningData()
Return reference to learning data

Returns:
reference to learning data

setFunctionalModel

public void setFunctionalModel(LearningFactorFunctionalModel functionalModel)
Set functional learning factor model

Parameters:
functionalModel - functional learning factor model

getFunctionalModel

public LearningFactorFunctionalModel getFunctionalModel()
Return function model

Returns:
function model

getBestNeuron

protected int getBestNeuron(double[] vector)
Rerturn number of best neuron for specified input vector

Parameters:
vector - input vector
Returns:
NeuronModelnumber

changeNeuronWeight

protected void changeNeuronWeight(int neuronNumber,
                                  double[] vector,
                                  int iteration,
                                  int distance)
Change neuron weights for specified neuron number, iteration, input data vector and distance and distance to winning neuron

Parameters:
distance - distance to winning neuron
neuronNumber - neuron number
vector - input vector
iteration - iteration number

changeWeight

public void changeWeight(int neuronNumber,
                         double[] vector,
                         int iteration)
Change specified neuron weight

Parameters:
neuronNumber - neuron Number
vector - input vector
iteration - iteration number

learn

public void learn()
Start learning process