对于神经网络,存在线性层之后会有非线性函数。本片文章主要针对的就是激励函数的设计。本文介绍了一种新的激励函数,它基于每个神经元的核扩张(based on an inexpensive kernel expansion at every neuron),本文针对设计以及初始化这些核函数(KAFs)提出多种变形。结果表明,KAFs能够近似表示任何定义在实线子集上的映射,不管它是凸还是非凸。KAFs能够在整个域上光滑(smooth over their entire domain),linear in their parameters,并且能够使用任何已知的模式来规则化,包括使用 。
在NNs中,激励函数一般是一个element-wise,(sub-)differentiable, and fixed 的非线性函数。现在逐渐从收缩映射(sigmoids)激励函数转为使用分段线性函数(piecewise-linear functions)比如ReLUs,在BP error 的计算上更为有效。
在设计方面有两个问题,第一,我们可以使用少量的参数来参数化一个已知的激励函数,这会导致在灵活性以及性能上有少量的提升
对于一个前馈神经网络,第
层,
,
is applied element-wise。
训练网络的时候,提供输入输出集合
,损失函数为
对于激励函数的选择,和 tasks 以及 a proper scaling of the output相关,不能随便选取。对于回归问题使用
,
代表的是单个输入。对于二分类问题
,使用 sigmoid function。
在NNs中最常使用的是一种非减的函数,也就是说
,
c为0或者1,依赖于约定。
另外一种是双曲正切
但是在实际的运用中会出现梯度消失和梯度爆炸的问题。
一个突破是ReLU的提出
。第一,ReLU的梯度要么是0要么是1,第二,(activations are sparse)激励项是稀疏的。
softplus 是 ReLU的一个smoothed version:
为了解决‘dying ReLU’,就是说因为初始化或者权重更新问题,激励项变成了0, 因此引入 leaky ReLU
其中
,被设为很小,比如0.01.
对于仅仅有非负的输出值激励函数,一个问题是他们的平均值是正的(这是什么问题??)Another problem of activation functions having only non-negative output values is that their mean value is always positive by de nition.。受自然梯度natural gradient的启发,提出了exponential linear unit (ELU)
scaled ELU (SELU):
,其中
Swish inspired by the gating steps in a standard LSTM recurrent cell 提出了
是一个sigmoid。
提高NN灵活性的一种快速的方法就是参数化之前介绍的激励函数(activations functions with a xed (small) number of adaptable parameters),只要这些激励函数可以微分,就可以用过数值优化算法(numerical optimization algorithm)进行优化。
因为这些函数的参数数目固定并且缺乏灵活性,所以叫做Parametric adaptable activation functions。
generalized hyperbolic tangent 双曲正切:含有两个正数标量
,随机初始化,相互独立,a控制输出的范围,b控制曲线的坡度。
parametric version of the leaky ReLU:
, 叫做parametric ReLU (PReLU)
a modi cation of the ELU function in (9) with an additional scalar parameter , called parametric ELU(PELU):
,其中
随机初始化,并且在训练过程中更新。
A more flexible proposal is S-shaped ReLU (SReLU)parameterized by four scalar values
a parametric version of the Swish function is
参数化的激励函数的灵活性受限,非参数化的激励函数可以给大规模数据建模(allow to model a larger class of shapes),主要是对超参数的引入。
generalizes the SReLU function in (15) by summing multiple linear segments,
多项式插值(polynomial activation function PAF)
是超参数,有
个系数
drawbacks: 每一个
有全局的影响。
为了解决 smoothness problem,引入两种变种
soft-maxout:
For our experiments, we use the 1D Gaussian kernel de ned as
Selecting
is crucial for the well-behavedness of the method
many methods have been proposed to select the bandwidth parameter for performing kernel density estimation,但是对于核密度估计(kernel density estimation)的问题,(the abscissa corresponds to a given dataset with an arbitrary distribution.)所以,KAF中,abscissa 通过一个网格grid选取
本文没有把
看作一个超参数,而是从经验上设定
其中
是网格点(grid points)之间的距离
对于KAF,初始化的不同,会有性能的差异,所以可以通过对参数进行初始化来得到想要激励函数。如图:
使用kernel ridge regression 来初始化 the mixing coefficients
其中
表示希望的得到的KAF的初始值,与字典元素相对应
,
是通过
得到的核矩阵。
对于2D-KAF,作用于pair of 激励函数上,而不是单个的,最终学习一个两维度的函数。
for each possible pair of activations
,可得到:
KAF: they are smooth over their entire domain, and their operations can be implemented easily with a high degree of vectorization