jhpro.nnet.jknnl
Class WTMLearningFunction
- java.lang.Object
-
- jhpro.nnet.jknnl.WTMLearningFunction
-
- Direct Known Subclasses:
- WTMLearningFunctionWithTired
public class WTMLearningFunction extends java.lang.ObjectWinner Takes Most - algorithm where wining neuron and neurons in neighborhood 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 iteration
w(k) - neuron weight for k iteration
n - value of learning function factor for k iteration
N(i,x) - value of neighborhood function for i - specified neuron x - learning vector od data w - neuron weight- See Also:
WTMLearningFunction
-
-
Constructor Summary
Constructors Constructor and Description WTMLearningFunction(NetworkModel networkModel, int maxIteration, MetricModel metrics, LearningDataModel learningData, LearningFactorFunctionalModel functionalModel, NeighbourhoodFunctionModel neighboorhoodFunction)Creates a new instance of WTMLearningFunction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidchangeWeight(int neuronNumber, double[] vector, int iteration)Change specified neuron weightintgetBestNeuron(double[] vector)Rerturn number of best neuron for specified input vectorLearningFactorFunctionalModelgetFunctionalModel()Return function modelLearningDataModelgetLearningData()Return reference to learning dataintgetMaxIteration()Return maximal number of iterationMetricModelgetMetrics()Return metricsNeighbourhoodFunctionModelgetNeighboorhoodFunction()Return reference to neighboorhood functionNetworkModelgetNetworkModel()Return network modelbooleanisShowComments()Return information if learning process displays information about learning process.voidlearn()Start learning processvoidsetFunctionalModel(LearningFactorFunctionalModel functionalModel)Set functional learning factor modelvoidsetLearningData(LearningDataModel learningData)Set reference to learning datavoidsetMaxIteration(int maxIteration)Set max interationvoidsetMetrics(MetricModel metrics)Set metricsvoidsetNeighboorhoodFunction(NeighbourhoodFunctionModel neighboorhoodFunction)Set reference to neighboorhood functionvoidsetNetworkModel(NetworkModel networkModel)Set network modelvoidsetShowComments(boolean showComments)Set if comments during learning process must be shown.
-
-
-
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 ModelmaxIteration- max number of iterationmetrics- reference to metricslearningData- reference to learning datafunctionalModel- reference to functional ModelneighboorhoodFunction- reference to Neighborhood Function
-
-
Method Detail
-
isShowComments
public boolean isShowComments()
Return information if learning process displays information about learning process.- Returns:
- true if learning process display information
-
setShowComments
public void setShowComments(boolean showComments)
Set if comments during 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
public int getBestNeuron(double[] vector)
Rerturn number of best neuron for specified input vector- Parameters:
vector- input vector- Returns:
- NeuronModelnumber
-
changeWeight
public void changeWeight(int neuronNumber, double[] vector, int iteration)Change specified neuron weight- Parameters:
neuronNumber- neuron Numbervector- input vectoriteration- iteration number
-
learn
public void learn()
Start learning process
-
-
DMelt 3.0 © DataMelt by jWork.ORG