CPN
org.encog.neural.cpn

Class CPN

  • All Implemented Interfaces:
    Serializable, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression, MLResettable


    public class CPNextends BasicMLimplements 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 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:
        calculateError in interface MLError
        Parameters:
        data - The training set.
        Returns:
        The error percentage.
      • compute

        public MLData compute(MLData input)
        Compute regression.
        Specified by:
        compute in interface MLRegression
        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:
        getInputCount in interface MLInput
        Returns:
        The input.
      • getInstarCount

        public int getInstarCount()
        Returns:
        The instar count, same as the input count.
      • getOutputCount

        public int getOutputCount()
        Specified by:
        getOutputCount in interface MLOutput
        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:
        reset in interface MLResettable
      • reset

        public void reset(int seed)
        Reset the weights with a seed.
        Specified by:
        reset in interface MLResettable
        Parameters:
        seed - The seed value.

SCaVis 1.7 © jWork.org