Fix softplus formula
This commit is contained in:
parent
c41e3874ca
commit
e378e24739
1 changed files with 1 additions and 1 deletions
|
|
@ -36,7 +36,7 @@ namespace psemek::ml
|
||||||
case activation_type::softplus:
|
case activation_type::softplus:
|
||||||
return (x < T{0})
|
return (x < T{0})
|
||||||
? std::log(T{1} + std::exp(x))
|
? std::log(T{1} + std::exp(x))
|
||||||
: x + std::log(T{1} + std::exp(-1));
|
: x + std::log(T{1} + std::exp(-x));
|
||||||
case activation_type::squareplus:
|
case activation_type::squareplus:
|
||||||
return (x < T{0})
|
return (x < T{0})
|
||||||
? T{2} / (std::sqrt(x * x + T{4}) - x)
|
? T{2} / (std::sqrt(x * x + T{4}) - x)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue