jhpro.nnet.jknnl
Class WTALearningFunction
- java.lang.Object
-
- jhpro.nnet.jknnl.WTALearningFunction
-
- Direct Known Subclasses:
- WTALearningFunctionWithTired
public class WTALearningFunction extends java.lang.ObjectWinner Takes All - algorithm there only wining neuron weights are changed according to the formula w(k+1) = w(k) + n * (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
x - learning vector of data w - neuron weight- See Also:
WTMLearningFunction
-
-
Constructor Summary
Constructors Constructor and Description WTALearningFunction(NetworkModel networkModel, int maxIteration, MetricModel metrics, LearningDataModel learningData, LearningFactorFunctionalModel functionalModel)Creates a new instance of WTALearningFunction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetBestNeuron(double[] vector)Return number of the best neuron for specified input vectorLearningFactorFunctionalModelgetFunctionalModel()Return function modelLearningDataModelgetLearningData()Return reference to learning dataintgetMaxIteration()Return maximal number of iterationMetricModelgetMetrics()Return metricsNetworkModelgetNetworkModel()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 iterationvoidsetMetrics(MetricModel metrics)Set metricsvoidsetNetworkModel(NetworkModel networkModel)Set network modelvoidsetShowComments(boolean showComments)Set if comments during learning process must be shown.
-
-
-
Constructor Detail
-
WTALearningFunction
public WTALearningFunction(NetworkModel networkModel, int maxIteration, MetricModel metrics, LearningDataModel learningData, LearningFactorFunctionalModel functionalModel)
Creates a new instance of WTALearningFunction.- Parameters:
networkModel- network modelmaxIteration- iteration numbermetrics- metricslearningData- learning datafunctionalModel- functional model- See Also:
MetricModel,LearningData,NetworkModel,LearningFactorFunctionalModel
-
-
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
-
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 iteration- Parameters:
maxIteration- max iteration
-
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)
Return number of the best neuron for specified input vector- Parameters:
vector- input vector- Returns:
- Neuron number
-
learn
public void learn()
Start learning process
-
-
DMelt 3.0 © DataMelt by jWork.ORG