From b338ca1ed1295f53e74b64750657d363b386576f Mon Sep 17 00:00:00 2001 From: chaoming Date: Wed, 3 Jan 2024 14:52:25 +0800 Subject: [PATCH] update --- brainpy/_src/math/activations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brainpy/_src/math/activations.py b/brainpy/_src/math/activations.py index a840eaa7..54ced5d4 100644 --- a/brainpy/_src/math/activations.py +++ b/brainpy/_src/math/activations.py @@ -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):