Skip to content

Commit

Permalink
Enhanced docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmoein committed Nov 17, 2023
1 parent 269cdef commit 7873c45
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 27 deletions.
38 changes: 30 additions & 8 deletions docs/HTML/BoxCoxVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@
-->
<!DOCTYPE html>
<html>

<style>
.frac {
display: inline-block;
position: relative;
vertical-align: middle;
letter-spacing: 0.001em;
text-align: center;
}
.frac > span {
display: block;
padding-top: 0.01em;
padding-bottom: 0.01em;
}
.frac span.bottom {
border-top: thin solid white;
padding-top: 0.4em;
padding-bottom: 0.3em;
}
.frac span.symbol { display: none; }
</style>

<body>

<table align="center" border="1">
Expand All @@ -35,20 +57,20 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>
enum class box_cox_type : unsigned char {
// y(λ) = (y<sup>λ</sup> - 1) / λ, if λ != 0
// y(λ) = log(y), if λ == 0
// y(λ) = <div class="frac"> <span>y<sup>λ</sup> - 1</span> <span class="symbol">/</span> <span class="bottom">λ</span></div> if λ != 0
// y(λ) = log(y) if λ == 0
original = 1,

// y(λ) = (y<sup>λ</sup> - 1) / (λ * GM<sup>(λ - 1)</sup>), if λ != 0
// y(λ) = GM * log(y), if λ == 0
// 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
// y(λ) = GM * log(y) if λ == 0
geometric_mean = 2,

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

// y(λ) = (e<sup>λy</sup> - 1) / λ, if λ != 0
// y(λ) = y, if λ == 0
// y(λ) = <div class="frac"><span>e<sup>λy</sup> - 1</span> <span class="symbol">/</span> <span class="bottom">λ</span></div> if λ != 0
// y(λ) = y if λ == 0
exponential = 4,
};</B></PRE> </font>
</td>
Expand Down
39 changes: 30 additions & 9 deletions docs/HTML/LossFuncVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,29 @@
-->
<!DOCTYPE html>
<html>
<body>

<style>
.frac {
display: inline-block;
position: relative;
vertical-align: middle;
letter-spacing: 0.001em;
text-align: center;
}
.frac > span {
display: block;
padding-top: 0.01em;
padding-bottom: 0.01em;
}
.frac span.bottom {
border-top: thin solid white;
padding-top: 0.4em;
padding-bottom: 0.3em;
}
.frac span.symbol { display: none; }
</style>

<body>

<table align="center" border="1">
<tr bgcolor="lightblue">
Expand All @@ -36,31 +57,31 @@
<PRE><B>
enum class loss_function_type : unsigned char {
// P = Probability(Actual), Q = Probability(Model)
kullback_leibler = 1, // L = &sum;[P(x) * log(P(x) / Q(x))]
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>]

// y = Actual, y&#770; = Model
mean_abs_error = 2, // L = &sum;[|y<sub>i</sub> - y&#770;<sub>i</sub>|] / N
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>

// y = Actual, y&#770; = Model
mean_sqr_error = 3, // L = &sum;[(y<sub>i</sub> - y&#770;<sub>i</sub>)<sup>2</sup>] / N
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>

// y = Actual, y&#770; = Model
mean_sqr_log_error = 4, // L = &sum;[(log(1 + y<sub>i</sub>) - log(1 + y&#770;<sub>i</sub>))<sup>2</sup>] / N
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>

// y = Actual, P(y<sub>i</sub>) = Model probability prediction
cross_entropy = 5, // L = -&sum;[y<ub>i</sub> * log(P(y<sub>i</sub>))] / N
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>

// y = Actual binary (0/1), P(y<sub>i</sub>) = Model probability prediction
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
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>

// y = Actual, y&#770; = Model
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]

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

// y = Actual, y&#770; = Model
log_cosh = 9, // L = &sum;[log(cosh(y&#770;<sub>i</sub> - y<sub>i</sub>))] / N
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>
};</B></PRE> </font>
</td>
<td>
Expand Down
26 changes: 24 additions & 2 deletions docs/HTML/ReturnVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@
-->
<!DOCTYPE html>
<html>

<style>
.frac {
display: inline-block;
position: relative;
vertical-align: middle;
letter-spacing: 0.001em;
text-align: center;
}
.frac > span {
display: block;
padding-top: 0.01em;
padding-bottom: 0.01em;
}
.frac span.bottom {
border-top: thin solid white;
padding-top: 0.4em;
padding-bottom: 0.3em;
}
.frac span.symbol { display: none; }
</style>

<body>

<table align="center" border="1">
Expand All @@ -35,8 +57,8 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>
enum class return_policy : unsigned char {
log = 1, // log(X<sub>t</sub> / X<sub>t-1</sub>)
percentage = 2, // (X<sub>t</sub> - X<sub>t-1</sub>) / X<sub>t-1</sub>
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>
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>
monetary = 3, // X<sub>t</sub> - X<sub>t-1</sub>
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
};
Expand Down
38 changes: 30 additions & 8 deletions docs/HTML/SigmoidVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@
-->
<!DOCTYPE html>
<html>

<style>
.frac {
display: inline-block;
position: relative;
vertical-align: middle;
letter-spacing: 0.001em;
text-align: center;
}
.frac > span {
display: block;
padding-top: 0.01em;
padding-bottom: 0.01em;
}
.frac span.bottom {
border-top: thin solid white;
padding-top: 0.4em;
padding-bottom: 0.3em;
}
.frac span.symbol { display: none; }
</style>

<body>

<table align="center" border="1">
Expand All @@ -34,11 +56,11 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>
enum class sigmoid_type : unsigned char {
logistic = 1, // f(x) = 1 / (1 + e<sup>-x</sup>)
algebraic = 2, // f(x) = 1 / &radic;<span style="text-decoration:overline;">1 + x<sup>2</sup></span>
logistic = 1, // f(x) = <div class="frac"> <span>1</span> <span class="symbol">/</span> <span class="bottom">1 + e<sup>-x</sup></span> </div>
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>
hyperbolic_tan = 3, // f(x) = tanh(x)
arc_tan = 4, // f(x) = atan(x)
error_function = 5, // f(x) = 2 / &radic;<span style="text-decoration:overline;">&#8508;</span> * &int; e<sup>-t<sup>2</sup></sup> dt
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
gudermannian = 6, // f(x) = atan(sinh(x))
smoothstep = 7, // f(x) = 0 if x <= 0, 1 if x >= 1, else 3x<sup>2</sup> - 2x<sup>3</sup>
};</B></PRE> </font>
Expand All @@ -60,13 +82,13 @@
<PRE><B>
enum class rectify_type : unsigned char {
ReLU = 1, // f(x) = x if x > 0 else 0
param_ReLU = 2, // f(x) = x if x > 0 else a * x, a <= 1
GeLU = 3, // f(x) = x * &Phi;(x), &Phi; = Standard Normal Dist
param_ReLU = 2, // f(x) = x if x > 0 else a * x a <= 1
GeLU = 3, // f(x) = x * &Phi;(x) &Phi; = Standard Normal Dist
SiLU = 4, // f(x) = x * Sigmoid(x)
softplus = 5, // f(x) = log(1 + e<sup>a * x</sup>) / a, a != 0
elu = 6, // f(x) = x if x > 0 else a * (e<sup>x</sup> - 1), a >= 0
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
elu = 6, // f(x) = x if x > 0 else a * (e<sup>x</sup> - 1) a >= 0
mish = 7, // f(x) = x * tanh(softplus(x))
metallic_mean = 8, // f(x) = (x + &radic;<span style="text-decoration:overline;">x<sup>2</sup> + 4</span>) / 2
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>
};</B></PRE> </font>
</td>
<td>
Expand Down

0 comments on commit 7873c45

Please sign in to comment.