File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -262,19 +262,11 @@ Return `log(exp(x) - 1)` or the “invsoftplus” function. It is the inverse o
262
262
logexpm1 (x:: Real ) = x <= 18.0 ? log (_expm1 (x)) : x <= 33.3 ? x - exp (- x) : oftype (exp (- x), x)
263
263
logexpm1 (x:: Float32 ) = x <= 9f0 ? log (expm1 (x)) : x <= 16f0 ? x - exp (- x) : oftype (exp (- x), x)
264
264
265
- function softplus (x; a:: Real = 1.0 )
266
- if a == 1.0
267
- return log1pexp (x)
268
- end
269
- return log1pexp (a * x) / a
270
- end
265
+ softplus (x:: Real ) = log1pexp (x)
266
+ softplus (x:: Real , a:: Real ) = log1pexp (a * x) / a
271
267
272
- function invsoftplus (y; a:: Real = 1.0 )
273
- if a == 1.0
274
- return logexpm1 (y)
275
- end
276
- return logexpm1 (a * y) / a
277
- end
268
+ invsoftplus (y:: Real ) = logexpm1 (y)
269
+ invsoftplus (y:: Real , a:: Real ) = logexpm1 (a * y) / a
278
270
279
271
280
272
"""
You can’t perform that action at this time.
0 commit comments