Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix brainpy.math.softplus and brainpy.dnn.SoftPlus #581

Merged
merged 7 commits into from
Jan 3, 2024
Merged

Conversation

chaoming0625
Copy link
Collaborator

@chaoming0625 chaoming0625 commented Jan 3, 2024

No description provided.

@chaoming0625
Copy link
Collaborator Author

#580

@Dr-Chen-Xiaoyu
Copy link

It seems that threshold needs to be divided by beta “return jnp.where( x > threshold/beta , ...” , based on the description of softplus "input X beta > threshold"

@chaoming0625
Copy link
Collaborator Author

Exactly. Currently, the algorithm is:

jnp.where(x * beta > threshold, x, 1 / beta * jnp.logaddexp(beta * x, 0))

Thanks for the suggestion.

@chaoming0625 chaoming0625 merged commit 786283d into master Jan 3, 2024
32 checks passed
@chaoming0625 chaoming0625 deleted the fix-580 branch January 3, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants