Skip to content

Commit 7873c45

Browse files
committed
Enhanced docs
1 parent 269cdef commit 7873c45

File tree

4 files changed

+114
-27
lines changed

4 files changed

+114
-27
lines changed

docs/HTML/BoxCoxVisitor.html

+30-8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@
2424
-->
2525
<!DOCTYPE html>
2626
<html>
27+
28+
<style>
29+
.frac {
30+
display: inline-block;
31+
position: relative;
32+
vertical-align: middle;
33+
letter-spacing: 0.001em;
34+
text-align: center;
35+
}
36+
.frac > span {
37+
display: block;
38+
padding-top: 0.01em;
39+
padding-bottom: 0.01em;
40+
}
41+
.frac span.bottom {
42+
border-top: thin solid white;
43+
padding-top: 0.4em;
44+
padding-bottom: 0.3em;
45+
}
46+
.frac span.symbol { display: none; }
47+
</style>
48+
2749
<body>
2850

2951
<table align="center" border="1">
@@ -35,20 +57,20 @@
3557
<td bgcolor="maroon"> <font color="white">
3658
<PRE><B>
3759
enum class box_cox_type : unsigned char {
38-
// y(λ) = (y<sup>λ</sup> - 1) / λ, if λ != 0
39-
// y(λ) = log(y), if λ == 0
60+
// y(λ) = <div class="frac"> <span>y<sup>λ</sup> - 1</span> <span class="symbol">/</span> <span class="bottom">λ</span></div> if λ != 0
61+
// y(λ) = log(y) if λ == 0
4062
original = 1,
4163

42-
// y(λ) = (y<sup>λ</sup> - 1) / (λ * GM<sup>(λ - 1)</sup>), if λ != 0
43-
// y(λ) = GM * log(y), if λ == 0
64+
// y(λ) = <div class="frac"> <span>y<sup>λ</sup> - 1</span> <span class="symbol">/</span> <span class="bottom"> λ * GM<sup>(λ - 1)</sup></span> </div> if λ != 0
65+
// y(λ) = GM * log(y) if λ == 0
4466
geometric_mean = 2,
4567

46-
// y(λ) = sign(y) * (((|y| + 1)<sup>λ</sup> - 1) / λ), if λ != 0
47-
// y(λ) = sign(y) * log(|y| + 1), if λ == 0
68+
// y(λ) = sign(y) * <div class="frac"><span>(|y| + 1)<sup>λ</sup> - 1</span> <span class="symbol">/</span> <span class="bottom">λ</span> </div> if λ != 0
69+
// y(λ) = sign(y) * log(|y| + 1) if λ == 0
4870
modulus = 3,
4971

50-
// y(λ) = (e<sup>λy</sup> - 1) / λ, if λ != 0
51-
// y(λ) = y, if λ == 0
72+
// y(λ) = <div class="frac"><span>e<sup>λy</sup> - 1</span> <span class="symbol">/</span> <span class="bottom">λ</span></div> if λ != 0
73+
// y(λ) = y if λ == 0
5274
exponential = 4,
5375
};</B></PRE> </font>
5476
</td>

docs/HTML/LossFuncVisitor.html

+30-9
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,29 @@
2424
-->
2525
<!DOCTYPE html>
2626
<html>
27-
<body>
2827

28+
<style>
29+
.frac {
30+
display: inline-block;
31+
position: relative;
32+
vertical-align: middle;
33+
letter-spacing: 0.001em;
34+
text-align: center;
35+
}
36+
.frac > span {
37+
display: block;
38+
padding-top: 0.01em;
39+
padding-bottom: 0.01em;
40+
}
41+
.frac span.bottom {
42+
border-top: thin solid white;
43+
padding-top: 0.4em;
44+
padding-bottom: 0.3em;
45+
}
46+
.frac span.symbol { display: none; }
47+
</style>
48+
49+
<body>
2950

3051
<table align="center" border="1">
3152
<tr bgcolor="lightblue">
@@ -36,31 +57,31 @@
3657
<PRE><B>
3758
enum class loss_function_type : unsigned char {
3859
// P = Probability(Actual), Q = Probability(Model)
39-
kullback_leibler = 1, // L = &sum;[P(x) * log(P(x) / Q(x))]
60+
kullback_leibler = 1, // L = &sum;[P(x) * log <div class="frac"> <span>P(x)</span> <span class="symbol">/</span> <span class="bottom">Q(x)</span></div>]
4061

4162
// y = Actual, y&#770; = Model
42-
mean_abs_error = 2, // L = &sum;[|y<sub>i</sub> - y&#770;<sub>i</sub>|] / N
63+
mean_abs_error = 2, // L = <div class="frac"> <span>&sum;|y<sub>i</sub> - y&#770;<sub>i</sub>|</span> <span class="symbol">/</span> <span class="bottom">N</span> </div>
4364

4465
// y = Actual, y&#770; = Model
45-
mean_sqr_error = 3, // L = &sum;[(y<sub>i</sub> - y&#770;<sub>i</sub>)<sup>2</sup>] / N
66+
mean_sqr_error = 3, // L = <div class="frac"> <span>&sum;(y<sub>i</sub> - y&#770;<sub>i</sub>)<sup>2</sup></span> <span class="symbol">/</span> <span class="bottom">N</span> </div>
4667

4768
// y = Actual, y&#770; = Model
48-
mean_sqr_log_error = 4, // L = &sum;[(log(1 + y<sub>i</sub>) - log(1 + y&#770;<sub>i</sub>))<sup>2</sup>] / N
69+
mean_sqr_log_error = 4, // L = <div class="frac"> <span>&sum;[(log(1 + y<sub>i</sub>) - log(1 + y&#770;<sub>i</sub>))<sup>2</sup>]</span> <span class="symbol">/</span> <span class="bottom">N</span> </div>
4970

5071
// y = Actual, P(y<sub>i</sub>) = Model probability prediction
51-
cross_entropy = 5, // L = -&sum;[y<ub>i</sub> * log(P(y<sub>i</sub>))] / N
72+
cross_entropy = 5, // L = <div class="frac"> <span>-&sum;[y<ub>i</sub> * log(P(y<sub>i</sub>))]</span> <span class="symbol">/</span> <span class="bottom">N</span> </div>
5273

5374
// y = Actual binary (0/1), P(y<sub>i</sub>) = Model probability prediction
54-
binary_cross_entropy = 6, // L = &sum;[-(y<ub>i</sub> * log(P(y<sub>i</sub>))) + (1 - y<sub>i</sub>) * log(1 - P(y<sub>i</sub>))] / N
75+
binary_cross_entropy = 6, // L = <div class="frac"> <span>&sum;[-(y<ub>i</sub> * log(P(y<sub>i</sub>))) + (1 - y<sub>i</sub>) * log(1 - P(y<sub>i</sub>))]</span> <span class="symbol">/</span> <span class="bottom">N</span> </div>
5576

5677
// y = Actual, y&#770; = Model
5778
categorical_hinge = 7, // L = max[&sum;[(1 - y<sub>i</sub>) * y&#770;<sub>i</sub>] - &sum;[y<sub>i</sub> * y&#770;<sub>i</sub>] + 1, 0]
5879

5980
// Y = Actual, Y&#770; = Model
60-
cosine_similarity = 8, // L = (Y . Y&#770;) / (||Y|| * ||Y&#770;||)
81+
cosine_similarity = 8, // L = <div class="frac"> <span>Y . Y&#770;</span> <span class="symbol">/</span> <span class="bottom">||Y|| * ||Y&#770;||</span> </div>
6182

6283
// y = Actual, y&#770; = Model
63-
log_cosh = 9, // L = &sum;[log(cosh(y&#770;<sub>i</sub> - y<sub>i</sub>))] / N
84+
log_cosh = 9, // L = <div class="frac"> <span>&sum;log(cosh(y&#770;<sub>i</sub> - y<sub>i</sub>))</span> <span class="symbol">/</span> <span class="bottom">N</span> </div>
6485
};</B></PRE> </font>
6586
</td>
6687
<td>

docs/HTML/ReturnVisitor.html

+24-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@
2424
-->
2525
<!DOCTYPE html>
2626
<html>
27+
28+
<style>
29+
.frac {
30+
display: inline-block;
31+
position: relative;
32+
vertical-align: middle;
33+
letter-spacing: 0.001em;
34+
text-align: center;
35+
}
36+
.frac > span {
37+
display: block;
38+
padding-top: 0.01em;
39+
padding-bottom: 0.01em;
40+
}
41+
.frac span.bottom {
42+
border-top: thin solid white;
43+
padding-top: 0.4em;
44+
padding-bottom: 0.3em;
45+
}
46+
.frac span.symbol { display: none; }
47+
</style>
48+
2749
<body>
2850

2951
<table align="center" border="1">
@@ -35,8 +57,8 @@
3557
<td bgcolor="maroon"> <font color="white">
3658
<PRE><B>
3759
enum class return_policy : unsigned char {
38-
log = 1, // log(X<sub>t</sub> / X<sub>t-1</sub>)
39-
percentage = 2, // (X<sub>t</sub> - X<sub>t-1</sub>) / X<sub>t-1</sub>
60+
log = 1, // log <div class="frac"> <span>X<sub>t</sub></span> <span class="symbol">/</span> <span class="bottom">X<sub>t-1</sub></span> </div>
61+
percentage = 2, // <div class="frac"> <span>X<sub>t</sub> - X<sub>t-1</sub></span> <span class="symbol">/</span> <span class="bottom">X<sub>t-1</sub></span> </div>
4062
monetary = 3, // X<sub>t</sub> - X<sub>t-1</sub>
4163
trinary = 4, // 1 if X<sub>t</sub> - X<sub>t-1</sub> > 0, -1 if X<sub>t</sub> - X<sub>t-1</sub> < 0, else 0
4264
};

docs/HTML/SigmoidVisitor.html

+30-8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@
2424
-->
2525
<!DOCTYPE html>
2626
<html>
27+
28+
<style>
29+
.frac {
30+
display: inline-block;
31+
position: relative;
32+
vertical-align: middle;
33+
letter-spacing: 0.001em;
34+
text-align: center;
35+
}
36+
.frac > span {
37+
display: block;
38+
padding-top: 0.01em;
39+
padding-bottom: 0.01em;
40+
}
41+
.frac span.bottom {
42+
border-top: thin solid white;
43+
padding-top: 0.4em;
44+
padding-bottom: 0.3em;
45+
}
46+
.frac span.symbol { display: none; }
47+
</style>
48+
2749
<body>
2850

2951
<table align="center" border="1">
@@ -34,11 +56,11 @@
3456
<td bgcolor="maroon"> <font color="white">
3557
<PRE><B>
3658
enum class sigmoid_type : unsigned char {
37-
logistic = 1, // f(x) = 1 / (1 + e<sup>-x</sup>)
38-
algebraic = 2, // f(x) = 1 / &radic;<span style="text-decoration:overline;">1 + x<sup>2</sup></span>
59+
logistic = 1, // f(x) = <div class="frac"> <span>1</span> <span class="symbol">/</span> <span class="bottom">1 + e<sup>-x</sup></span> </div>
60+
algebraic = 2, // f(x) = <div class="frac"> <span>1</span> <span class="symbol">/</span> <span class="bottom">&radic;<span style="text-decoration:overline;">1 + x<sup>2</sup></span></span> </div>
3961
hyperbolic_tan = 3, // f(x) = tanh(x)
4062
arc_tan = 4, // f(x) = atan(x)
41-
error_function = 5, // f(x) = 2 / &radic;<span style="text-decoration:overline;">&#8508;</span> * &int; e<sup>-t<sup>2</sup></sup> dt
63+
error_function = 5, // f(x) = <div class="frac"> <span>2</span> <span class="symbol">/</span> <span class="bottom">&radic;<span style="text-decoration:overline;">&#8508;</span></span> </div> * &int; e<sup>-t<sup>2</sup></sup> dt
4264
gudermannian = 6, // f(x) = atan(sinh(x))
4365
smoothstep = 7, // f(x) = 0 if x <= 0, 1 if x >= 1, else 3x<sup>2</sup> - 2x<sup>3</sup>
4466
};</B></PRE> </font>
@@ -60,13 +82,13 @@
6082
<PRE><B>
6183
enum class rectify_type : unsigned char {
6284
ReLU = 1, // f(x) = x if x > 0 else 0
63-
param_ReLU = 2, // f(x) = x if x > 0 else a * x, a <= 1
64-
GeLU = 3, // f(x) = x * &Phi;(x), &Phi; = Standard Normal Dist
85+
param_ReLU = 2, // f(x) = x if x > 0 else a * x a <= 1
86+
GeLU = 3, // f(x) = x * &Phi;(x) &Phi; = Standard Normal Dist
6587
SiLU = 4, // f(x) = x * Sigmoid(x)
66-
softplus = 5, // f(x) = log(1 + e<sup>a * x</sup>) / a, a != 0
67-
elu = 6, // f(x) = x if x > 0 else a * (e<sup>x</sup> - 1), a >= 0
88+
softplus = 5, // f(x) = <div class="frac"> <span>log(1 + e<sup>ax</sup>)</span> <span class="symbol">/</span> <span class="bottom">a</span> </div> a != 0
89+
elu = 6, // f(x) = x if x > 0 else a * (e<sup>x</sup> - 1) a >= 0
6890
mish = 7, // f(x) = x * tanh(softplus(x))
69-
metallic_mean = 8, // f(x) = (x + &radic;<span style="text-decoration:overline;">x<sup>2</sup> + 4</span>) / 2
91+
metallic_mean = 8, // f(x) = <div class="frac"> <span>x + &radic;<span style="text-decoration:overline;">x<sup>2</sup> + 4</span></span> <span class="symbol">/</span> <span class="bottom">2</span> </div>
7092
};</B></PRE> </font>
7193
</td>
7294
<td>

0 commit comments

Comments
 (0)