Relu3 - An example kernel¶
def relu3(x: float) -> float:
"""
Like ReLu, but smoother
Like GeLu, but cheaper
"""
if x < 0.0:
return 0.0
elif x < 1.0:
return 1 / 3 * x ** 3
else:
return x - 2 / 3
def relu3(x: float) -> float:
"""
Like ReLu, but smoother
Like GeLu, but cheaper
"""
if x < 0.0:
return 0.0
elif x < 1.0:
return 1 / 3 * x ** 3
else:
return x - 2 / 3