Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoming0625 committed Jan 3, 2024
1 parent c138e73 commit b338ca1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion brainpy/_src/math/activations.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def softplus(x, beta: float = 1., threshold: float = 20.):
"""
x = x.value if isinstance(x, Array) else x
return jnp.where(x * beta > threshold, x, 1 / beta * jnp.logaddexp(beta * x, 0))
return jnp.where(x > threshold / beta, x, 1 / beta * jnp.logaddexp(beta * x, 0))


def log_sigmoid(x):
Expand Down

0 comments on commit b338ca1

Please sign in to comment.