深度网络的一些常用激活函数,并通过matplot绘制出来:
import matplotlib.pyplot as plt
import numpy as np
def relu(x):
return np.maximum(0, x)
def leaky_relu(x, alpha=0.01):
return np.where(x > 0, x, alpha * x)
def gelu(x):
return 0.5 * x * (1 + np.tanh(np.sqrt(2

最低0.47元/天 解锁文章
5万+

被折叠的 条评论
为什么被折叠?



