Neural Networks

Sigmoid


    Public Shared Function Sigmoid(ByRef Value As Integer) As Double

        'z = Bias + (Input*Weight)
        'Output = 1/1+e**z
        Return 1 / (1 + Math.Exp(-Value))
    End Function


    Public Shared Function SigmoidDerivitive(ByRef Value As Integer) As Double


        Return Sigmoid(Value) * (1 - Sigmoid(Value))
    End Function


Neural Network TransferFunctions

posted Jan 20, 2016, 3:05 PM by Leroy Dyer [ updated Jan 20, 2016, 3:25 PM ]

the neural network is a tool used for classification and has currently become a hot topic as it has accomplished some advanced classification issues, yet it can be said that a neural net is only as good as its transfer functions!!


A few transfer functions been created in this class which i have created.

Some of the functions have derivatives and some do not.

The class itself doesn't need to be instantiated the EvaluateTransferFunct function allows for the input to return the result to the caller.


Hyperboloic Tangent

Public Shared Function HyperbolicTangent(ByRef Value As Double) As Double
        '    TanH(x) = (Math.Exp(x) - Math.Exp(-x)) / (Math.Exp(x) + Math.Exp(-x))
        
   Return Math.Tanh(Value)
End Function


Public Shared Function HyperbolicTangentDerivative(ByRef Value As Double) As Double
   HyperbolicTangentDerivative = 1 - (HyperbolicTangent(Value) * HyperbolicTangent(Value)) * Value
End Function