QUICK REVIEW
[论文解读] Squareplus: A Softplus-Like Algebraic Rectifier
Jonathan T. Barron|arXiv (Cornell University)|Dec 22, 2021
Parallel Computing and Optimization Techniques被引用 10
一句话总结
本文提出了一种可微分、非负的激活函数 Squareplus,其通过仅使用加法、乘法和平方根等代数运算来近似 softplus,相较于 CPU 上的 softplus 运算速度提升约 6 倍,且在大输入值下具有数值稳定性。与 softplus 不同,Squareplus 避免使用超越函数,因此在资源受限的深度学习环境中可实现高效部署,同时保持平滑性与 ReLU 类似的特性。
ABSTRACT
We present squareplus, an activation function that resembles softplus, but which can be computed using only algebraic operations: addition, multiplication, and square-root. Because squareplus is ~6x faster to evaluate than softplus on a CPU and does not require access to transcendental functions, it may have practical value in resource-limited deep learning applications.
研究动机与目标
- 开发一种类似 softplus 的激活函数,避免使用 exp 和 log 等昂贵的超越运算。
- 确保在大输入值下具有数值稳定性,此类输入常导致标准 softplus 实现失效。
- 在保持平滑性(C∞ 连续性)和非负性的同时,实现在计算受限环境中的更快推理速度。
- 提供一种可微分的激活函数,其渐近趋近于 ReLU,但保持连续梯度。
- 提供一个可调超参数 b,用于控制零点附近的曲率,实现类似 softplus 的形状调节能力。
提出的方法
- Squareplus 定义为 $\operatorname{squareplus}(x,b) = \frac{1}{2}\left(x + \sqrt{x^2 + b}\right)$,其中 $b \geq 0$ 为可学习或固定的超参数。
- 该函数仅由加法、乘法和平方根等代数运算构成,避免使用 exp 和 log。
- Squareplus 的一阶导数为 $\frac{1}{2}\left(1 + \frac{x}{\sqrt{x^2 + b}}\right)$,为一种代数形式的 sigmoid 类函数。
- 二阶导数为 $\frac{1}{2}\left(\frac{b}{(x^2 + b)^{3/2}}\right)$,当 $b = 2$ 时,其对应自由度 $\nu = 2$ 的 t-分布概率密度函数。
- 超参数 $b$ 充当尺度参数:$\frac{\operatorname{squareplus}(ax, b)}{a} = \operatorname{squareplus}\left(x, \frac{b}{a^2}\right)$。
- 当 $b = 0$ 时,Squareplus 精确退化为 ReLU;当 $b = 4\ln^2 2$ 时,其在 $x = 0$ 处与 softplus 值相等,并从上方严格上界控制 softplus。
实验结果
研究问题
- RQ1能否仅通过代数运算构造一种类似 softplus 的激活函数,以提升计算效率?
- RQ2一种代数激活函数是否能在避免大输入下数值不稳定性的同时,保持 softplus 的平滑性与非负性?
- RQ3Squareplus 在速度与梯度动态方面与 softplus 和 ReLU 相比表现如何?
- RQ4超参数 $b$ 是否可用于调节零点附近的曲率,实现类似 softplus 的形状控制?
- RQ5Squareplus 是否在 $x = 0$ 处保持连续梯度,并渐近趋近于 ReLU,如同 softplus 一般?
主要发现
- 在 CPU 上处理 100 万个输入时,Squareplus 的运行时间仅为 0.631 ms,而 softplus 为 3.777 ms,速度提升约 6 倍。
- 在 GPU 上,Squareplus 仅比 softplus 快约 10%,因为性能受限于内存带宽而非计算能力。
- Squareplus 在大输入下具有数值稳定性,而朴素的 softplus 实现因溢出问题在 $x \approx 15$ 左右即失效。
- 当 $b = 4$ 时,Squareplus 在 $x = 0$ 处的二阶导数与 softplus 完全一致:$\frac{1}{4}$。
- 在 $x = 0$ 处,当 $b = 4$ 时,Squareplus 输出值为 1.0,这是激活函数中自然且直观的取值。
- 对于所有 $b \geq 4\ln^2 2$,Squareplus 在所有点上均保证大于或等于 softplus,确保其为 ReLU 的有效上界。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。