org.encog.neural.som
Class SOM
- java.lang.Object
-
- org.encog.ml.BasicML
-
- org.encog.neural.som.SOM
-
- All Implemented Interfaces:
- java.io.Serializable, MLClassification, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLResettable
public class SOM extends BasicML implements MLClassification, MLResettable, MLError
A self organizing map neural network.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleVERYSMALLDo not allow patterns to go below this very small number.
-
Constructor Summary
Constructors Constructor and Description SOM()Default constructor.SOM(int inputCount, int outputCount)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalculateError(MLDataSet data)Calculate the error of the ML method, given a dataset.intclassify(MLData input)Classify the input into a group.intgetInputCount()intgetOutputCount()MatrixgetWeights()voidreset()Reset the weights.voidreset(int seed)Reset the weights with a seed.voidsetWeights(Matrix weights)voidupdateProperties()Update any objeccts when a property changes.intwinner(MLData input)An alias for the classify method, kept for compatibility with earlier versions of Encog.-
Methods inherited from class org.encog.ml.BasicML
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty
-
-
-
-
Field Detail
-
VERYSMALL
public static final double VERYSMALL
Do not allow patterns to go below this very small number.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SOM
public SOM()
Default constructor.
-
SOM
public SOM(int inputCount, int outputCount)The constructor.- Parameters:
inputCount- Number of input neuronsoutputCount- Number of output neurons
-
-
Method Detail
-
calculateError
public double calculateError(MLDataSet data)
Calculate the error of the ML method, given a dataset.- Specified by:
calculateErrorin interfaceMLError- Parameters:
data- The dataset.- Returns:
- The error.
-
classify
public int classify(MLData input)
Classify the input into a group.- Specified by:
classifyin interfaceMLClassification- Parameters:
input- The input data to classify.- Returns:
- The group that the data was classified into.
-
getInputCount
public int getInputCount()
- Specified by:
getInputCountin interfaceMLInput- Returns:
- The input.
-
getOutputCount
public int getOutputCount()
- Specified by:
getOutputCountin interfaceMLOutput- Returns:
- The output count.
-
getWeights
public Matrix getWeights()
- Returns:
- the weights
-
reset
public void reset()
Reset the weights.- Specified by:
resetin interfaceMLResettable
-
reset
public void reset(int seed)
Reset the weights with a seed.- Specified by:
resetin interfaceMLResettable- Parameters:
seed- The seed value.
-
setWeights
public void setWeights(Matrix weights)
- Parameters:
weights- the weights to set
-
updateProperties
public void updateProperties()
Update any objeccts when a property changes.- Specified by:
updatePropertiesin interfaceMLProperties- Specified by:
updatePropertiesin classBasicML
-
winner
public int winner(MLData input)
An alias for the classify method, kept for compatibility with earlier versions of Encog.- Parameters:
input- The input pattern.- Returns:
- The winning neuron.
-
-
DMelt 3.0 © DataMelt by jWork.ORG