def explnPrime(x):
    """ This function is the first derivative of the expln function (above).
        It is needed for the backward pass of the module. """
    def f(val):
        if val < 0:
            # exponential function for x<0
            return exp(val)
        else:
            # linear function for x>=0
            return 1.0 / (val + 1.0)
    try:
        result = array(list(map(f, x)))
    except __HOLE__:
        result = array(f(x))

    return result
dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/functions.py/explnPrime