SetInputValuesConvexEx(Var InputValues: Array; alfa: Double; doNormalize: Boolean);
InputValues. Real array of network input values.
alfa. Transformation coefficient. The value is in the range [0.0; 1.0].
doNormalize. The parameter determines whether to normalize input values.
The SetInputValuesConvexEx method sets network input values by using convex combinatorial transformation and possibility of normalization.
Convex combinatorial transformation is performed according to the formula:
Vi = alfa(t) * Vi + (1-alfa(t)) * (1/sqrt(number_of_network_inputs))
Available values of the doNormalize parameter:
True. Input values will be normalized. Sequential execution of the INeuralNetwork.SetInputValuesConvex and INeuralNetwork.NormalizeInputValues methods is identical to execution of SetInputValuesConvexEx with the doNormalize parameter equal to True.
False. Input values are not normalized.
As an example, a function is given, which input has neural network fed into (the Net parameter). To execute the example, add links to the NN and MathFin system assemblies.
Function m_SetInputValuesConvexEx(Net: NeuralNetwork): NeuralNetwork;
Var
InputCount, i: Integer;
InputVal: Array Of Double;
Begin
InputCount := Net.GetNumberOfInputs;
InputVal := New Double[InputCount];
For i := 0 To InputVal.Length - 1 Do
InputVal[i] := math.RandBetween(0.1, 1.0);
End For;
Net.SetInputValuesConvexEx(InputVal, 0.2, True);
Return Net;
End Function m_SetInputValuesConvexEx;
After executing the example the network input values are assigned by means of convex combinatorial transformation. The data is normalized.
See also: