public class WTALearningFunction extends java.lang.Object implements LearningFunction
Modifier and Type | Field and Description |
---|---|
protected LearningDataModel |
learningData
Reference to learning data
|
protected int |
maxIteration
Max number of iteration
|
protected NetworkModel |
networkModel
Reference to network model
|
Constructor and Description |
---|
WTALearningFunction(NetworkModel networkModel,
int maxIteration,
LearningDataModel learningData)
Creates a new instance of WTALearningFunction.
|
Modifier and Type | Method and Description |
---|---|
protected void |
changeNeuronWeight(int neuronNumber,
double[] vector,
int iteration)
Change neuron weights for specified neuron number,iteration and input data vector
|
protected int |
getBestNeuron(double[] vector)
Return number of the best neuron for specified input vector
|
LearningDataModel |
getLearningData()
Return reference to learning data
|
int |
getMaxIteration()
Return maximal number of iteration
|
NetworkModel |
getNetworkModel()
Return network model
|
void |
learn()
Start learning process
|
void |
setLearningData(LearningDataModel learningData)
Set reference to learning data
|
void |
setMaxIteration(int maxIteration)
Set max interation
|
void |
setNetworkModel(NetworkModel networkModel)
Set network model
|
protected NetworkModel networkModel
protected int maxIteration
protected LearningDataModel learningData
public WTALearningFunction(NetworkModel networkModel, int maxIteration, LearningDataModel learningData)
networkModel
- network modelmaxIteration
- iteration numberlearningData
- learning datapublic void setNetworkModel(NetworkModel networkModel)
networkModel
- network modelpublic NetworkModel getNetworkModel()
public void setMaxIteration(int maxIteration)
maxIteration
- max interationpublic int getMaxIteration()
public void setLearningData(LearningDataModel learningData)
learningData
- reference to learning datapublic LearningDataModel getLearningData()
protected int getBestNeuron(double[] vector) throws java.lang.Exception
vector
- input vectorjava.lang.Exception
- any error.protected void changeNeuronWeight(int neuronNumber, double[] vector, int iteration) throws java.lang.Exception
neuronNumber
- neuron numbervector
- input vectoriteration
- iteration numberjava.lang.Exception
- any error.public void learn() throws java.lang.Exception
learn
in interface LearningFunction
java.lang.Exception
- any error.