ANNEXED D
programming of some functions of activation
The function and objectives of an activation function vary depending on the objective and degree of transformation wished by the designer of the network. But the simple ones of them only try to standardize the data like work methodology. This returns them apt to use them like example functions.
{ Freeman 1992 } uses in its work the function sigmoide (or logistic)para the activation.
Of the original function 1/(1+exp(-x)), it ends up it turning into:
and = 1/(1+e^(- x 1 * 2 x )) +x 3
Programmed in Visual BASIC:
function sigmoide(sigmo1, sigmo2, sigmo3)
sigmoe = 2.718281828459050
sigmoide = 1/(1+sigmoe^(sigmo2 * - sigmo1)) +sigmo3
exit function
The panel A4.1 shows some usual functions of activation
PANEL A4.1 Some common functions of activation
FUNCTION
f(x) =
Conversion to cerouno
decimal_a_01(x)
Cosine
cos(x)
Hyperbolic tangent of X
tanh(x)
Hyperbolic tangent of 1,5 Xs
tanh(1.5*x)
Sine
sin(x)
Symmetrical Sigmoide
2/(1+exp(-x))-1
Gaussian
exp(-x 2 )
Complement of Gaussian
1-exp(-x 2 )
Example 1: Conversion to = 0/1 a simple function turns the input datas to format of Verdadero/Falso, symbolized like 0 - 1. For example, if what matters it is to know if the values are positive or negative exclusively and it does not interest his value, are possible to be turned all the positive data to 1 and the negatives to 0 with which the same result but with a concerted effort of processing is obtained.
The algorithm in pseudocodigo for this function is:
FUNCTION OF - DECIMAL - TO - CEROUNO
TO ENTER I NUMBER DECIMAL
IF I NUMBER HE IS SMALLER OR EQUAL TO 0 THEN
TO RETURN 0
IN OPPOSITE CASE
TO RETURN 1
TO FINISH
We see that the algorithm consists of a condition that returns one or another one of both values of answer value according to signs of the value of entrance
The programming of this algorithm in Visual BASIC is:
Decimal_a_01 function (deci Ace Variant) Ace Double
If deci < = 0 Then
Decimal_a_01 = 0
Else
Decimal_a_01 = 1
End If
End Function
The format cero/uno nevertheless has the disadvantage of which when multiplying nobody I number by zero the result gives zero, reason why the changes in the weights of the network become very abrupt. In order to avoid this other systems of annotation of two values are used, then that are not zero - one. The bipolar values serve as equal way that the zero - one but they use values 1 and - 1 reason why are no null values in multiplicación.La following function is a variant of the previous one using bipolar values.
The algorithm in pseudocodigo for this function is:
FUNCTION DECIMAL - TO - BIPOLAR
TO ENTER I NUMBER DECIMAL
IF I NUMBER HE IS SMALLER OR EQUAL TO 0.5 THEN
TO RETURN - 1
IN OPPOSITE CASE
TO RETURN 1
TO FINISH
Function to decimal_a_bipolar (deci Ace Variant) Ace Double
If deci < = 5 Then
to decimal_a_bipolar = - 1
Else
to decimal_a_bipolar = 1
End If
End Function
Example 3:Esta function returns I number decimal equivalent to I number binary dice. It is used in the cases that are considered advisable to work with data decimal instead of data in binary code
Binary Function - to - decimal (b2d Ace Variant) Ace Double
b2d = Trim(b2d)
bin2d = 0
lencadena = Len(b2d)
For i = 0 lencadena To - 1
cerouno = Val(Mid(b2d, lencadena - i, 1))
bin2d = bin2d + cerouno * (2 ^ i)
Next
binary - to - decimal = bin2d
End Function
Previous Pagina
Following Pagina