Skip to content

Commit 1e23894

Browse files
fix tanh func, typo
1 parent d2b6424 commit 1e23894

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

NN/FFN/basicFFN/include/ffn.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class FFN {
7272
static FP sigmoid(FP x) { return 1 / (1 + std::exp(-x)); }
7373
static FP sigmoid_deriv(FP y) { return y * (1 - y); }
7474
static FP tanh(FP x) {
75-
return (std::exp(x) - std::exp(-x)) / (std::exp(x) - std::exp(-x));
75+
return (std::exp(x) - std::exp(-x)) / (std::exp(x) + std::exp(-x));
7676
}
7777
static FP tanh_deriv(FP y) { return 1 - y * y; }
7878

0 commit comments

Comments
 (0)