-
Notifications
You must be signed in to change notification settings - Fork 4
/
activation.h
91 lines (61 loc) · 2.23 KB
/
activation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef AIFI__ACTIVATION
#define AIFI__ACTIVATION
// <INCLUDE> //
#include "popc.h"
// </INCLUDE> //
// <DEFINE> //
//#define REQUIRED STUFFS HERE
// </DEFINE> //
// -- V2 -- //
delegation double (fnPtr activationTransferDelegate) (double x);
delegation double (fnPtr activationTransferPrimeDelegate) (double x);
enumeration activationFunctionType {
aftNone,
aftIdentity,
aftBinary,
aftLogisticSigmoid, // Logistic
aftBipolarSigmoid, // Bipolar Sigmoid
aftArcTan, // Arc Tangent
aftHyperbolicTan, // Hyperbolic Tangent
aftExponentialLinerUnit, // Exponential Linear Unit
aftRectifiedLinerUnit, // Rectified Linear Unit
aftLeakyRectifiedLinerUnit, // Leakey Rectified Linear Unit
aftParametricRectifiedLinerUnit, // Parametric Rectified Linear Unit
aftSoftMax
} activationFunctionType;
subject activation {
activationFunctionType aft;
activationTransferDelegate activationTransferFunction;
activationTransferPrimeDelegate activationTransferFunctionPrime;
} activation;
pattern activationProto activationProto;
pattern activationProto {
activation ptr (fnPtr activationNew) (activationFunctionType aft);
void (fnPtr activationDel) ();
double (fnPtr sigmoid) (double x);
double (fnPtr sigmoidPrime) (double x);
double (fnPtr transfer) (double x);
double (fnPtr transferPrime) (double x);
void (fnPtr setActivationFunctionType) (activationFunctionType aft);
} activationProto;
#ifdef Cplusplus
extern "C" {
#endif
activationProto ptr activationProtoNew ();
activation ptr activationNew (activationFunctionType aft);
void activationDel (activation ptr);
double activationBipolarSigmoid (double x);
double activationBipolarSigmoidPrime (double x);
double activationLogisticSigmoid (double x);
double activationLogisticSigmoidPrime (double x);
double activationHyperbolicTan (double x);
double activationHyperbolicTanPrime (double x);
double activationRectifiedLinearUnit (double x);
double activationRectifiedLinearUnitPrime (double x);
double activationTransfer (activation ptr act, double x);
double activationTransferPrime (activation ptr act, double x);
void activationSetFunctionType (activation ptr act, activationFunctionType aft);
#ifdef Cplusplus
}
#endif
#endif