Skip to content

Commit

Permalink
use sigmoid function instead of tanh
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhkr committed May 13, 2014
1 parent 1d18786 commit 8681fc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neuralnetwork/neuralnetwork.go
Expand Up @@ -27,11 +27,11 @@ func vector(I int, fill float64) []float64 {
}

func sigmoid(x float64) float64 {
return math.Tanh(x)
return 1 / (1 + math.Exp(-x))
}

func dsigmoid(y float64) float64 {
return 1.0 - y*y
return y * (1 - y)
}

type NeuralNetwork struct {
Expand Down

0 comments on commit 8681fc7

Please sign in to comment.