PropagateBP;
PropagateBP();
The PropagateBP method propagates the signal in the back-propagation network.
A signal is an input vector. Output values of the neurons are calculated in the process of signal propagation. These values are the result of the network operation. To get output values, use the INeuralNetwork.GetOutputValues method.
When the INeuralNetwork.LearnBack method is executed, it implicitly calls PropagateBP.
As an example, a function is given, input of which has learned back-propagation network fed into its input (the Net parameter). To execute the example, add links to the NN, IO system assemblies.
Function m_BPTest(Net: NeuralNetwork): NeuralNetwork;
Var
NetFile: File;
TextW: ITextWriter;
i, NumberOfInp: Integer;
inputs, outputs: Array Of Double;
Begin
NetFile := New File.Create;
TextW := NetFile.OpenTextWriter("C:/BPTest.txt", True);
NumberOfInp := Net.GetNumberOfInputs;
inputs := New Double[NumberOfInp];
For i := 0 To NumberOfInp - 1 Do
inputs[i] := 0.5;
End For;
Net.SetInputValues(inputs);
Net.PropagateBP;
outputs := Net.GetOutputValues;
For i := 0 To outputs.Length - 1 Do
TextW.WriteLnString(outputs[i].ToString);
End For;
Return Net;
End Function m_BPTest;
After executing the example the learned network tests assigned input data. Results of work of the network are written to the file C:/BPTest.txt.
As an example, a function is given that has learned back-propagation network fed into its input (the Net parameter).
Imports Prognoz.Platform.Interop.NN;
…
Public Shared Function m_BPTest(Net: NeuralNetwork): NeuralNetwork;
Var
NetFile: StreamWriter;
i, NumberOfInp: Integer;
inputs, outputs: System.Array;
Begin
NetFile := File.CreateText("C:/BPTest.txt");
NumberOfInp := Net.GetNumberOfInputs();
inputs := New Double[NumberOfInp];
For i := 0 To NumberOfInp - 1 Do
inputs[i] := 0.5;
End For;
Net.SetInputValues(Var inputs);
Net.PropagateBP();
outputs := Net.GetOutputValues();
For i := 0 To outputs.Length - 1 Do
NetFile.WriteLine(outputs[i].ToString());
End For;
NetFile.Close();
Return Net;
End Function;
After executing the example the learned network tests assigned input data. Results of work of the network are written to the file C:/BPTest.txt.
See also: