-
Notifications
You must be signed in to change notification settings - Fork 4
/
loss.h
80 lines (64 loc) · 1.87 KB
/
loss.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
#ifndef AIFI__LOSS
#define AIFI__LOSS
// <INCLUDE> //
#include "popc.h"
// </INCLUDE> //
// <DEFINE> //
//#define REQUIRED STUFFS HERE
// </DEFINE> //
delegation double (fnPtr lossFunctionDelegate) (double t, double o);
delegation double (fnPtr lossFunctionPrimeDelegate) (double t, double o);
// <TYPE> //
enumeration lossFunctionType {
lftQuadraticMeanSquaredError,
lftMeanSquaredLogarithmicError,
lftActualError,
lftL1,
lftL2,
lftMeanAbsoluteError,
lftMeanAbsolutePercentageError,
lftRelativeEntropy,
lftCrossEntropy,
lftKullbackLeiblerDivergence,
lftNegativeLogarithmicLikelihood,
lftPoisson,
lftCosineProximity,
lftHinge,
lftSquaredHinge,
} lossFunctionType;
subject loss{
lossFunctionType lft;
lossFunctionDelegate lossTransferFunction;
lossFunctionPrimeDelegate lossTransferFunctionPrime;
} loss;
pattern lossProto {
} lossProto;
// </TYPE> //
// <DECLARATION> //
#ifdef Cplusplus
extern "C" {
#endif
loss ptr lossNew (lossFunctionType lft);
void lossDel (loss ptr act);
double lossQuadraticMeanSquaredError (double t, double o);
double lossMeanSquaredLogarithmicError (double t, double o);
double lossL1 (double t, double o);
double lossL2 (double t, double o);
double lossActualError (double t, double o);
double lossActualErrorPrime (double t, double o);
double lossMeanAbsoluteError (double t, double o);
double lossMeanAbsoluteErrorPrime (double t, double o);
double lossMeanAbsolutePercentageError (double t, double o);
double lossRelativeEntropy (double t, double o);
double lossCrossEntropy (double t, double o);
double lossKullbackLeiblerDivergence (double t, double o);
double lossNegativeLogarithmicLikelihood (double t, double o);
double lossPoisson (double t, double o);
double lossCosineProximity (double t, double o);
double lossHinge (double t, double o);
double lossSquaredHinge (double t, double o);
#ifdef Cplusplus
}
#endif
// </DECLARATION> //
#endif