BP Neural Networks

Using MPE for Back Propagation Neural Networks is so easy and straightforward:

Training a BPNN:

  1. Declare a variable of type "FF_NeuralNetwork".

    FF_NeuralNetwork NN


     

  2. Initialize the network settings.

    NN.Function = FCN_TANSIG
    NN.Bias = -1
    NN.InputsNumber = 2
    NN.LayersNumber = 2
    NN.NeuronsInLayers = [ 2 ; 1] //"1" will be the "outputs number".

    NN.Train.LearningMaxError = 0.01
    NN.Train.LearningConstant = 0.3

    NN.Train.MaxEpochs = 200000
    NN.Train.UpdateEpochs = 1000
    NN.Train.TextMessageLearning = 1


     

  3. Initialize the network weights.

    Integer i
    For i=1 To NN.LayersNumber
        NN.Weights(i) = RANDOM_ELEMENTS(-1 , 1)// Initialize edges' weights.
    Next


     

  4. Give the training pairs to the network. (Either manually or from a text file.)

    NN.Train.AddTrainingPair ([1,1],-1)
    NN.Train.AddTrainingPair ([0,0],-1)
    NN.Train.AddTrainingPair ([0,1],1)
    NN.Train.AddTrainingPair ([1,0],1)


     

  5. Optional : Give the testing pairs to it. (Either manually or from a text file.)

    NN.Train.AddTestingPair ([1,1],-1)
    NN.Train.AddTestingPair ([0,0],-1)

     

  6. Start Learning.

    NN.Train.StartLearning()

     

  7. Save the trained network.

    SaveObject   NN   In  "C:/MPE/XOR.nn"

Using a BPNN:

  1. Declare a variable of type "FF_NeuralNetwork".

    FF_NeuralNetwork NN


     

  2. Train the network or load a previously saved one into it.

    LoadObject NN From "C:/MPE/XOR.nn"

     

  3. Give the inputs.

    NN.InputValues = [1,0]

     

  4. Perform the simulation (i.e. showing the outputs to the network.)

    NN.Simulate()

     

  5. Obtain the outputs.

    Println NN.Output.toString()

 

To know more about using the Neural Networks in MPE, please refer to the step-by-step samples that are included in the downloadable folder of the software.