INeuralNetwork.SetInputValuesConvex

Fore Syntax

SetInputValuesConvex(Var InputValues: Array; alfa: Double);

Fore.NET Syntax

SetInputValuesConvex(Var InputValues: System.Array; alfa: double);

Parameters

InputValues. Real array of network input values.

alfa. Transformation coefficient. The value is in the range [0.0; 1.0].

Description

The SetInputValuesConvex method sets network input values by means of convex combinatorial transformation.

Comments

Convex combinatorial transformation is performed according to the formula:

Vi = alfa(t) * Vi + (1-alfa(t)) * (1/sqrt(number_of_network_inputs))

This method makes the process of Kohonen self-organizing maps learning more accurate. In the beginning of the learning the alfa coefficient approximately equals to zero and all the input values are approximately equal. Further on, value of the alfa coefficient tends to zero and the input values tend to vary more.

Sequential execution of the NeuralNetwork.SetInputValues and INeuralNetwork.ApplyConvexCombinationFactor methods is similar to execution of SetInputValuesConvex.

Fore Example

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_SetInputValuesConvex(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.11.0);
    End For;
    Net.SetInputValuesConvex(InputVal, 0.2);
    Return Net;
End Function m_SetInputValuesConvex;

After executing the example network input values are assigned by means of the convex combinatorial transformation.

Fore.NET Example

As an example, a function is given, which input has neural network fed into (the Net parameter).

Imports Prognoz.Platform.Interop.NN;
Imports Prognoz.Platform.Interop.MathFin;

Public Shared Function m_SetInputValuesConvex(Net: NeuralNetwork): NeuralNetwork;
Var
    InputCount, i: Integer;
    InputVal: System.Array;
    ValGen: Prognoz.Platform.Interop.MathFin.Math;
Begin
    InputCount := Net.GetNumberOfInputs();
    InputVal := New Double[InputCount];
    ValGen := New Prognoz.Platform.Interop.MathFin.Math.Create();
    For i := 0 To InputVal.Length - 1 Do
        InputVal[i] := ValGen.RandBetween(0.11.0);
    End For;
    Net.SetInputValuesConvex(Var InputVal, 0.2);
    Return Net;
End Function m_SetInputValuesConvex;

After executing the example the network input values are assigned by means of the convex combinatorial transformation.

See also:

INeuralNetwork