Last active
February 8, 2019 18:07
-
-
Save justindmartin/5856162 to your computer and use it in GitHub Desktop.
This is a sigmoid function in PHP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sigmoid($t){ | |
return 1 / (1 + pow(M_EULER, -$t)); | |
} | |
?> |
The problem with it is M_EULER should be M_E.
Both work (with M_E, that is). Anyone happen to have softmax PHP function handy?
Wrote a basic softmax in case anyone's interested: https://gist.github.com/raymondjplante/d826df05349c1d4350e0aa2d7ca01da4
Thanks a million! was looking for this function! so simple!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I happened to google this looking to use a signoid curve. I found yours didn't work, but this did.