Skip to content

Commit 0c0ab2a

Browse files
Add inverse
1 parent 0a03aba commit 0c0ab2a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

ext/LogExpFunctionsInverseFunctionsExt.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ InverseFunctions.inverse(::typeof(logitexp)) = loglogistic
2222
InverseFunctions.inverse(::typeof(log1mlogistic)) = logit1mexp
2323
InverseFunctions.inverse(::typeof(logit1mexp)) = log1mlogistic
2424

25+
InverseFunctions.inverse(::typeof(softplus)) = invsofplus
26+
InverseFunctions.inverse(::typeof(invsofplus)) = softplus
27+
2528
end # module

test/inverse.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717

1818
InverseFunctions.test_inverse(log1mlogistic, randexp())
1919
InverseFunctions.test_inverse(logit1mexp, -randexp())
20+
21+
InverseFunctions.test_inverse(softplus, randn())
22+
InverseFunctions.test_inverse(invsoftplus, randexp())
2023
end

0 commit comments

Comments
 (0)