You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is also called the ["softplus"](https://en.wikipedia.org/wiki/Rectifier_(neural_networks))
166
166
transformation, being a smooth approximation to `max(0,x)`. Its inverse is [`logexpm1`](@ref).
167
167
168
-
The generalized `softplus` function (Wiemann et al., 2024) takes an additional optional parameter `a` that control
169
-
the approximation error with respect to the linear spline. It defaults to `a=1.0`, in which case the softplus is
170
-
equivalent to `log1pexp`.
168
+
This is also called the ["softplus"](https://en.wikipedia.org/wiki/Rectifier_(neural_networks))
169
+
transformation (in its default parametrization, see [`softplus`](@ref)), being a smooth approximation to `max(0,x)`.
171
170
172
171
See:
173
172
* Martin Maechler (2012) [“Accurately Computing log(1 − exp(− |a|))”](http://cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf)
174
-
* Wiemann, P. F., Kneib, T., & Hambuckers, J. (2024). Using the softplus function to construct alternative link functions in generalized linear models and beyond. Statistical Papers, 65(5), 3155-3180.
175
173
"""
176
174
log1pexp(x::Real) =_log1pexp(float(x)) # ensures that BigInt/BigFloat, Int/Float64 etc. dispatch to the same algorithm
177
175
@@ -262,6 +260,16 @@ Return `log(exp(x) - 1)` or the “invsoftplus” function. It is the inverse o
262
260
logexpm1(x::Real) = x <=18.0?log(_expm1(x)) : x <=33.3? x -exp(-x) :oftype(exp(-x), x)
263
261
logexpm1(x::Float32) = x <=9f0?log(expm1(x)) : x <=16f0? x -exp(-x) :oftype(exp(-x), x)
264
262
263
+
"""
264
+
$(SIGNATURES)
265
+
266
+
The generalized `softplus` function (Wiemann et al., 2024) takes an additional optional parameter `a` that control
267
+
the approximation error with respect to the linear spline. It defaults to `a=1.0`, in which case the softplus is
268
+
equivalent to [`log1pexp`](@ref).
269
+
270
+
See:
271
+
* Wiemann, P. F., Kneib, T., & Hambuckers, J. (2024). Using the softplus function to construct alternative link functions in generalized linear models and beyond. Statistical Papers, 65(5), 3155-3180.
0 commit comments