예제 #1
0
def softExp(x, a):
    if a == 0:
        return x
    elif a > 0:
        return (algebra.exp(a * x) - 1) / a + a
    else:
        return -(algebra.log(1 - a * (x + a))) / a
예제 #2
0
def logistic(x):
    return 1 / (1 + algebra.exp(-x))
예제 #3
0
def d_gaussian(x):
    return -2 * x * algebra.exp(-x**2)
예제 #4
0
def gaussian(x):
    return algebra.exp(-x**2)
예제 #5
0
def d_softExp(x, a):
    if a < 0:
        return 1 / (1 - a * (a + x))
    else:
        return algebra.exp(a * x)
예제 #6
0
def d_softplus(x):
    return 1 / (1 + algebra.exp(-x))
예제 #7
0
def softplus(x):
    return algebra.log(1 + algebra.exp(x))
예제 #8
0
def elu(x, a):
    if x < 0:
        return a * (algebra.exp(x) - 1)
    else:
        return x