Commit 4c4c7d72 authored by Konstantin Baierer's avatar Konstantin Baierer Committed by GitHub
Browse files

Merge pull request #201 from tmbdev/cliping-exp

Clip exponential in ffunc to avoid overflow
parents 24b311db 66c6007a
......@@ -380,7 +380,8 @@ class MLP(Network):
def ffunc(x):
"Nonlinearity used for gates."
return 1.0/(1.0+exp(-x))
# cliping to avoid overflows
return 1.0/(1.0+exp(clip(-x,-20,20)))
def fprime(x,y=None):
"Derivative of nonlinearity used for gates."
if y is None: y = sigmoid(x)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment