BP Neural Networks
Using MPE for Back Propagation Neural Networks is so easy and straightforward:
Training a BPNN:
Declare a variable of type "FF_NeuralNetwork".
| FF_NeuralNetwork NN |
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 |
Initialize the network weights.
| Integer i For i=1 To NN.LayersNumber NN.Weights(i) = RANDOM_ELEMENTS(-1 , 1)// Initialize edges' weights. Next |
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) |
Optional : Give the testing pairs to it. (Either manually or from a text file.)
|
NN.Train.AddTestingPair ([1,1],-1) |
Start Learning.
| NN.Train.StartLearning() |
Save the trained network.
| SaveObject NN In "C:/MPE/XOR.nn" |
Using a BPNN:
Declare a variable of type "FF_NeuralNetwork".
| FF_NeuralNetwork NN |
Train the network or load a previously saved one into it.
| LoadObject NN From "C:/MPE/XOR.nn" |
Give the inputs.
| NN.InputValues = [1,0] |
Perform the simulation (i.e. showing the outputs to the network.)
| NN.Simulate() |
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.