Beispiel #1
0
    private int[] mXVector; // input (X) vector

    #endregion Fields

    #region Methods

    // Public Functions //
    // Initialise                                   //
    // Initialises ART1 vectors at required length  //
    // Clears lists from previous runs              //
    // Adds single output node to recognition field //
    public void Initialise()
    {
        // Create ART vector arrays
        mXVector = new int[ mNumberOfInputNodes ];
        mCVector = new int[ mNumberOfInputNodes ];
        mTVector = new int[ mNumberOfInputNodes ];

        // Tidy lists
        mInputPatterns.Clear();
        mRecognitionField.Clear();

        // Create and initialise one outputnode and add to recognition field
        BinaryOutputNode blankNode = new BinaryOutputNode();
        blankNode.Initialise( mNumberOfInputNodes );
        mRecognitionField.Add ( blankNode );
    }
Beispiel #2
0
    // Train                                                                        //
    // Trains the best match node that passes a vigilance test                      //
    // Required to calculate the number of active bits in the comparison (Z) vector //
    // Sets the nodes feed forward weights using this number                        //
    // Sets the feed back weights to the comparison (Z) vector as new exemplar      //
    private void Train()
    {
        // Get number of active bits in comparison (Z) vector to rescale winning nodes feedforward weights
        int numberOfActiveBits = 0; // counter for number of active 'bits' in comparison vector

        // Looping through number of bits in input (X) vector
        for( int i = 0; i < mNumberOfInputNodes; i++ ) {
            numberOfActiveBits += mCVector[ i ]; // sum of number of active bits
        }

        // Train winning output node
        mRecognitionField[ mBestNeuron ].Train( mCVector, numberOfActiveBits );

        // Create and initialise one outputnode and add to recognition field
        BinaryOutputNode blankNode = new BinaryOutputNode();
        blankNode.Initialise( mNumberOfInputNodes );
        mRecognitionField.Add( blankNode );
    }