org.encog.neural.cpn
Class CPN
- java.lang.Object
-
- org.encog.ml.BasicML
-
- org.encog.neural.cpn.CPN
-
- All Implemented Interfaces:
- java.io.Serializable, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression, MLResettable
public class CPN extends BasicML implements MLRegression, MLResettable, MLError
Counterpropagation Neural Networks (CPN) were developed by Professor Robert Hecht-Nielsen in 1987. CPN neural networks are a hybrid neural network, employing characteristics of both a feedforward neural network and a self-organzing map (SOM). The CPN is composed of three layers, the input, the instar and the outstar. The connection from the input to the instar layer is competitive, with only one neuron being allowed to win. The connection between the instar and outstar is feedforward. The layers are trained separately, using instar training and outstar training. The CPN network is good at regression.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description CPN(int theInputCount, int theInstarCount, int theOutstarCount, int theWinnerCount)Construct the counterpropagation neural network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalculateError(MLDataSet data)Calculate the error for this neural network.MLDatacompute(MLData input)Compute regression.MLDatacomputeInstar(MLData input)Compute the instar layer.MLDatacomputeOutstar(MLData input)Compute the outstar layer.intgetInputCount()intgetInstarCount()intgetOutputCount()intgetOutstarCount()MatrixgetWeightsInputToInstar()MatrixgetWeightsInstarToOutstar()intgetWinnerCount()voidreset()Reset the weights.voidreset(int seed)Reset the weights with a seed.voidupdateProperties()Update any objeccts when a property changes.-
Methods inherited from class org.encog.ml.BasicML
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty
-
-
-
-
Constructor Detail
-
CPN
public CPN(int theInputCount, int theInstarCount, int theOutstarCount, int theWinnerCount)Construct the counterpropagation neural network.- Parameters:
theInputCount- The number of input neurons.theInstarCount- The number of instar neurons.theOutstarCount- The number of outstar neurons.theWinnerCount- The winner count.
-
-
Method Detail
-
calculateError
public double calculateError(MLDataSet data)
Calculate the error for this neural network.- Specified by:
calculateErrorin interfaceMLError- Parameters:
data- The training set.- Returns:
- The error percentage.
-
compute
public MLData compute(MLData input)
Compute regression.- Specified by:
computein interfaceMLRegression- Parameters:
input- The input data.- Returns:
- The output data.
-
computeInstar
public MLData computeInstar(MLData input)
Compute the instar layer.- Parameters:
input- The input.- Returns:
- The output.
-
computeOutstar
public MLData computeOutstar(MLData input)
Compute the outstar layer.- Parameters:
input- The input.- Returns:
- The output.
-
getInputCount
public int getInputCount()
- Specified by:
getInputCountin interfaceMLInput- Returns:
- The input.
-
getInstarCount
public int getInstarCount()
- Returns:
- The instar count, same as the input count.
-
getOutputCount
public int getOutputCount()
- Specified by:
getOutputCountin interfaceMLOutput- Returns:
- The output count.
-
getOutstarCount
public int getOutstarCount()
- Returns:
- The outstar count, same as the output count.
-
getWeightsInputToInstar
public Matrix getWeightsInputToInstar()
- Returns:
- The weights between the input and instar.
-
getWeightsInstarToOutstar
public Matrix getWeightsInstarToOutstar()
- Returns:
- The weights between the instar and outstar.
-
getWinnerCount
public int getWinnerCount()
- Returns:
- The winner count.
-
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.
-
updateProperties
public void updateProperties()
Update any objeccts when a property changes.- Specified by:
updatePropertiesin interfaceMLProperties- Specified by:
updatePropertiesin classBasicML
-
-
DMelt 3.0 © DataMelt by jWork.ORG