BAM
org.encog.neural.bam

Class BAM

  • All Implemented Interfaces:
    Serializable, MLMethod, MLProperties


    public class BAMextends BasicML
    Bidirectional associative memory (BAM) is a type of neural network developed by Bart Kosko in 1988. The BAM is a recurrent neural network that works similarly that allows patterns of different lengths to be mapped bidirectionally to other patterns. This allows it to act as almost a two-way hash map. During training the BAM is fed pattern pairs. The two halves of each pattern do not have to be the to be of the same length. However all patterns must be of the same overall structure. The BAM can be fed a distorted pattern on either side and will attempt to map to the correct value.
    See Also:
    Serialized Form
    • Constructor Detail

      • BAM

        public BAM()
        Default constructor, used mainly for persistence.
      • BAM

        public BAM(int theF1Count,   int theF2Count)
        Construct the BAM network.
        Parameters:
        theF1Count - The F1 count.
        theF2Count - The F2 count.
    • Method Detail

      • addPattern

        public void addPattern(MLData inputPattern,              MLData outputPattern)
        Add a pattern to the neural network.
        Parameters:
        inputPattern - The input pattern.
        outputPattern - The output pattern(for this input).
      • clear

        public void clear()
        Clear any connection weights.
      • compute

        public MLData compute(MLData input)
        Setup the network logic, read parameters from the network. NOT USED, call compute(NeuralInputData).
        Parameters:
        input - NOT USED
        Returns:
        NOT USED
      • compute

        public NeuralDataMapping compute(NeuralDataMapping input)
        Compute the network for the specified input.
        Parameters:
        input - The input to the network.
        Returns:
        The output from the network.
      • getF1Count

        public int getF1Count()
        Returns:
        the f1Count
      • getF2Count

        public int getF2Count()
        Returns:
        the f2Count
      • getWeightsF1toF2

        public Matrix getWeightsF1toF2()
        Returns:
        the weightsF1toF2
      • getWeightsF2toF1

        public Matrix getWeightsF2toF1()
        Returns:
        the weightsF2toF1
      • setF1Count

        public void setF1Count(int i)
        Set the F1 neuron count.
        Parameters:
        i - The count.
      • setF2Count

        public void setF2Count(int i)
        Set the F2 neuron count.
        Parameters:
        i - The count.
      • setWeightsF1toF2

        public void setWeightsF1toF2(Matrix matrix)
        Set the weights for F1 to F2.
        Parameters:
        matrix - The weight matrix.
      • setWeightsF2toF1

        public void setWeightsF2toF1(Matrix matrix)
        Set the weights for F2 to F1.
        Parameters:
        matrix - The weight matrix.

SCaVis 1.7 © jWork.org