def sigmoid(x,returntype=LINALGMAXFLOAT):
'''
Soft-threshold function (rescaled hyperbolic tangent)
More numerically stable version
'''
return returntype(sexp(-np.logaddexp(ZERO128,-np.float128(x))))
# Sigmoid and derivatives
评论列表
文章目录