首页 > 编程知识 正文

elu,elu激活函数优缺点

时间:2023-05-03 20:33:59 阅读:191152 作者:3200

Elu激活函数论文:https://arxiv.org/pdf/1511.07289v5.pdf
论文理解:https://blog.csdn.net/傲娇的金针菇_xiao_feng/article/details/53242235?locationNum=9&fps=1
https://blog.csdn.net/m0_37561765/article/details/78398098
https://blog.csdn.net/u012524708/article/details/79579313

Elu函数融合了sigmoid和ReLU,左侧具有软饱和性,右侧无饱和性。右侧线性部分使得ELU能够缓解梯度消失,而左侧软饱能够让ELU对输入变化或噪声更鲁棒。ELU的输出均值接近于零,所以收敛速度更快。在 ImageNet上,不加 Batch Normalization 30 层以上的 ReLU 网络会无法收敛,PReLU网络在MSRA的Fan-in (caffe )初始化下会发散,而 ELU 网络在Fan-in/Fan-out下都能收敛。

python画激活函数
参考:https://blog.csdn.net/Xin_101/article/details/93738819
(threshold、sigmoid、Relu、PRelu、tanh)
Elu函数

import matplotlib.pyplot as pltimport mpl_toolkits.axisartist as axisartistimport numpy as npimport mathfig = plt.figure(figsize=(6, 6))ax = axisartist.Subplot(fig, 111)fig.add_axes(ax)# 隐藏坐标轴ax.axis[:].set_visible(False)# 添加坐标轴ax.axis['x'] = ax.new_floating_axis(0, 0)ax.axis['y'] = ax.new_floating_axis(1, 0)# x轴添加箭头ax.axis['x'].set_axisline_style('-|>', size=1.0)ax.axis['y'].set_axisline_style('-|>', size=1.0)# 设置坐标轴刻度显示方向ax.axis['x'].set_axis_direction('top')ax.axis['y'].set_axis_direction('right')plt.xlim(-10, 10)plt.ylim(-2.5, 10)x_1 = np.arange(0, 10, 0.1)y_1 = x_1x_axis = np.arange(-10, 10, 0.2)y_axis = np.arange(-0, 1, 0.2)plt.plot(x_1, y_1, 'r-', label=r'Elu=${stackrel{x,x>0}{alpha(exp(x)-1), x<=0}$')x_2 = np.arange(-10, 0, 0.1)y_2 = 1*(np.exp(x_2)-1)plt.plot(x_2, y_2, 'r-')plt.legend()#plt.savefig('lu.jpg')plt.show()

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。