def sigmod(x): ''' the sigmod function,tanh is a little better than the standard 1/(1+e^-x) :param x: the self variable :return: the value after tanh ''' return math.tanh(x)