Skip to content

Commit

Permalink
Fix error in the sigmoid function (#145)
Browse files Browse the repository at this point in the history
Change sigmoid function from 1 / (1 + np.exp(x)) to 1 / (1 + np.exp(-x))
TODO: Make patch release v.0.2.1
  • Loading branch information
ThomBerthou authored and Lj Miranda committed Jun 26, 2018
1 parent 094e2ef commit 18ccecc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyswarms/discrete/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,5 @@ def _sigmoid(self, x):
numpy.ndarray
Output sigmoid computation
"""
return 1 / (1 + np.exp(x))
return 1 / (1 + np.exp(-x))

0 comments on commit 18ccecc

Please sign in to comment.