Skip to content

Commit

Permalink
Fix bisigmoid activation function
Browse files Browse the repository at this point in the history
  • Loading branch information
mewilhel committed Oct 4, 2020
1 parent bf39779 commit 96e781d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/forward_operators/activation_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,16 @@ end
return sigmoid(x), sigmoid_deriv(x), p
end

@inline bisigmoid(x) = 1.0 - exp(-x)/(1 + exp(-x))
@inline bisigmoid(x::Float64) = 1.0 - exp(-x)/(1 + exp(-x))
@inline bisigmoid(x) = (1.0 - exp(-x))/(1.0 + exp(-x))
@inline bisigmoid(x::Float64) = (1.0 - exp(-x))/(1.0 + exp(-x))
@inline function bisigmoid(x::Interval{Float64})
xLintv = Interval(x.lo)
xUintv = Interval(x.hi)
xLc = 1.0 - exp(-xLintv)/(1 + exp(-xLintv))
xUc = 1.0 - exp(-xUintv)/(1 + exp(-xUintv))
xLc = (1.0 - exp(-xLintv))/(1.0 + exp(-xLintv))
xUc = (1.0 - exp(-xUintv))/(1.0 + exp(-xUintv))
return Interval(xLc.hi, xUc.hi)
end
@inline bisigmoid_deriv(x::Float64) = 0.5*(1.0 + bisigmoid(x))*(1.0 - bisigmoid(x))
@inline bisigmoid_deriv(x::Float64) = 0.5*exp(x)/(exp(x) + 1.0)^2
@inline function bisigmoid_env(x::Float64, y::Float64, z::Float64)
(x - y) - (bisigmoid(x) - bisigmoid(y))/bisigmoid_deriv(x)
end
Expand Down

0 comments on commit 96e781d

Please sign in to comment.