# 整流器（神经网络）

在神经网络中，整流器是一种激活函数：当输入为正时输出该输入，否则输出零（或零的某个小倍数）。其标准形式——整流线性单元（ReLU）——定义为 \( f(x) = \max(x, 0) \)。整流器之所以成为深度学习的默认非线性单元，是因为其计算代价低廉、对正输入的梯度恒为 1，并且避免了 sigmoid 与 tanh 单元中拖慢训练的饱和现象。<sup>[1](https://mlanthology.org/icml/2010/nair2010icml-rectified/)</sup><sup> • </sup><sup>[2](https://proceedings.mlr.press/v15/glorot11a.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | \( f(x) = \max(x, 0) \)；当 \( x > 0 \) 时导数为 1，当 \( x \leq 0 \) 时导数为 0，在恰好为 0 处导数无定义<sup>[3](https://arxiv.org/abs/2104.02523)</sup> |
| 关键论文 | Nair 与 Hinton，《整流线性单元改进受限玻尔兹曼机》，ICML 2010，第 807–814 页<sup>[1](https://mlanthology.org/icml/2010/nair2010icml-rectified/)</sup> |
| 监督学习中的采用 | Glorot、Bordes 与 Bengio（AISTATS 2011）证明，整流神经元的表现等于或优于 tanh 网络，并能产生含真零的稀疏表示<sup>[2](https://proceedings.mlr.press/v15/glorot11a.html)</sup> |
| 里程碑结果 | He 等人（ICCV 2015）将 PReLU 与针对整流器设计的初始化方法相结合，在 ImageNet 2012 上取得 4.94% 的 top-5 错误率，相较 GoogLeNet 的 6.66% 相对提升 26%<sup>[4](https://openaccess.thecvf.com/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf)</sup> |
| 主要失效模式 | 死亡 ReLU：神经元对任何输入都卡在输出 0；Lu 等人（2019）证明，当深度趋于无穷时，深层 ReLU 网络依概率死亡<sup>[5](https://arxiv.org/abs/1903.06733)</sup> |
| 框架支持 | PyTorch 中的 `nn.ReLU` 与 TensorFlow 中的 `tf.keras.layers.ReLU`，后者可配置 `max_value`、`negative_slope` 与 `threshold`<sup>[6](https://docs.pytorch.org/docs/stable/nn)</sup><sup> • </sup><sup>[7](https://www.tensorflow.org/api_docs/python/tf/keras/layers/ReLU)</sup> |

## 定义与性质

整流器将正值原样传递，并将所有负值映射为零。其导数在正侧为 1、在负侧为 0，因此梯度流经任何活跃单元时都不会收缩——这正是 ReLU 网络比使用 sigmoid 或 tanh 单元的网络更易优化的原因，后者的梯度会在饱和区消失。<sup>[3](https://arxiv.org/abs/2104.02523)</sup><sup> • </sup><sup>[8](https://arxiv.org/abs/1710.05941)</sup> 该函数在恰好为零处不可微，实践中通常通过选取某一侧的导数来处理这一点。<sup>[3](https://arxiv.org/abs/2104.02523)</sup>

还有两个性质塑造了它的普及。由于负输入的输出恰为零，整流器网络能构建含真零的稀疏表示，Glorot、Bordes 与 Bengio 发现这非常适合天然稀疏的数据。<sup>[2](https://proceedings.mlr.press/v15/glorot11a.html)</sup> 此外，与 sigmoid 单元不同，当信号穿过多层特征检测器时，整流单元能保留关于相对强度的信息——Nair 与 Hinton 在受限玻尔兹曼机的设定中展示了这一性质。<sup>[1](https://mlanthology.org/icml/2010/nair2010icml-rectified/)</sup>

## 历史

整流器的历史远早于它的现代成功。根据瑞士 AI 公司 NNAISENSE 总裁、卢加诺大学 IDSIA 实验室教授[于尔根·施密德胡伯](https://www.edgepedia.org/zh/jurgen-schmidhuber)（Jürgen Schmidhuber）所著的带注释的深度学习史，福岛邦彦（Fukushima）于 1969 年描述了整流线性单元，而他 1979/80 年的 Neocognitron——卷积网络在概念上的祖先——就使用了整流非线性。<sup>[9](https://people.idsia.ch/~juergen/deep-learning-history.html)</sup>

现代意义上的采用经历了三篇论文。Nair 与 Hinton 于 2010 年在受限[玻尔兹曼机](https://www.edgepedia.org/zh/boltzmann-machine)中引入带噪整流线性单元，作为“阶梯 sigmoid 单元”的高效近似，并在 NORB 物体识别与 [Labeled Faces in the Wild](https://www.edgepedia.org/zh/labeled-faces-in-the-wild) 人脸验证上展示了更好的特征。<sup>[1](https://mlanthology.org/icml/2010/nair2010icml-rectified/)</sup> 2011 年，当时任职于[蒙特利尔大学](https://www.edgepedia.org/zh/universite-de-montreal)的 Xavier Glorot、Antoine Bordes 与约书亚·本吉奥（Yoshua Bengio）将整流器引入监督式深层前馈网络，并证明在大型标注数据集上无需无监督预训练即可达到最佳性能。<sup>[2](https://proceedings.mlr.press/v15/glorot11a.html)</sup> AlexNet——Alex Krizhevsky、Ilya Sutskever 与杰弗里·辛顿（Geoffrey E. Hinton）于 2012 年提出的卷积网络，使用了非饱和神经元——在 LSVRC-2010 测试数据上取得 39.7% 的 top-1 与 18.9% 的 top-5 错误率，被广泛认为开启了现代深度学习时代。<sup>[10](https://papers.nips.cc/paper_files/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html)</sup>

## 变体

**泄漏形式与参数化形式。** 普通整流器在负侧的零梯度可能永久杀死一个单元。泄漏 ReLU 为负输入保留一个很小的斜率，而微软亚洲研究院的[何恺明](https://www.edgepedia.org/zh/kaiming-he)（Kaiming He）、张祥雨（Xiangyu Zhang）、任少卿（Shaoqing Ren）与孙剑（Jian Sun）提出的参数化 ReLU（PReLU）将该负斜率变为可学习参数，以几乎为零的额外计算代价改善模型拟合。<sup>[4](https://openaccess.thecvf.com/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf)</sup> 同一篇论文还推导出一种为整流非线性量身定制的初始化方法，即今所称的 He 初始化，使得从零开始训练极深的整流模型成为可能。<sup>[4](https://openaccess.thecvf.com/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf)</sup> 各框架还提供更多有界与随机化形式：PyTorch 在 `ReLU` 之外还提供 `ReLU6`、`LeakyReLU`、`RReLU`、`PReLU`、`ELU`、`SELU` 与 `CELU`。<sup>[6](https://docs.pytorch.org/docs/stable/nn)</sup>

**平滑近似。** 一些平滑的非单调函数柔化了整流器的折角，在某些场景中已取代普通 ReLU。Swish，\( f(x) = x \cdot \text{sigmoid}(\beta x) \)，由谷歌的自动化搜索发现，在更深的模型上往往优于 ReLU；将 ReLU 替换为 Swish 单元后，Mobile NASNet-A 的 ImageNet top-1 准确率提升 0.9%，Inception-ResNet-v2 提升 0.6%。<sup>[8](https://arxiv.org/abs/1710.05941)</sup> Dan Hendrycks 与 Kevin Gimpel 提出的高斯误差线性单元（GELU）将每个输入乘以标准高斯累积分布函数，\( \text{GELU}(x) = x \cdot \Phi(x) \)；当 \( \mu = 0 \) 且 \( \sigma \to 0 \) 时，它恰好变为 ReLU，且在作者测试的计算机视觉、自然语言处理与语音任务中均优于 ReLU 与 ELU。<sup>[11](https://arxiv.org/abs/1606.08415)</sup>

## 死亡 ReLU 问题

若一个 ReLU 神经元对每个样本都接收到负输入，它就输出零；又因为该处梯度也为零，它接收不到任何学习信号，即所谓“死亡”。Lu Lu、Yeonjong Shin、Yanhui Su 与 George Em Karniadakis 严格证明：当权重取自关于零对称的分布时，随着深度趋于无穷，深层 ReLU 网络终将依概率死亡，并提出一种可证明能防止此现象的随机非对称初始化。<sup>[5](https://arxiv.org/abs/1903.06733)</sup> He 初始化——根据输入单元数设定初始权重的方差——是标准的实用缓解手段，此外还可改用泄漏 ReLU 或 ELU。<sup>[4](https://openaccess.thecvf.com/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf)</sup><sup> • </sup><sup>[5](https://arxiv.org/abs/1903.06733)</sup>

## 实证比较

基准结果表明，没有哪一种整流器变体占据绝对优势。在 Nguyen、Pham、Ngo、Ngo 与 Pham（2021）的分析中，MNIST 上 784-2048-2048-512-10 架构的 MLP 使用 ReLU 达到 97.5%/96.4% 的评估/测试准确率，而 SELU 达到 99.0%/97.0%；但 GELU 每个训练轮次耗时 82.37 秒，ReLU 为 11.86 秒，ISRLU 为 23.98 秒。<sup>[3](https://arxiv.org/abs/2104.02523)</sup> 在 DCASE 2018 声学场景分类任务上，使用类 VGGish 的 CNN，排序则相反：在配备批归一化与 dropout 的情况下，ReLU（63.9%）优于 ELU（61.7%）、SELU（61.4%）、GELU（63.1%）与 ISRLU（60.1%），作者据此得出结论：整流器变体应与归一化或正则化层结合使用，而不应单独依赖。<sup>[3](https://arxiv.org/abs/2104.02523)</sup> 一项 2026 年在 CIFAR-10、CIFAR-100 与 MNIST 上对九种激活函数的比较研究报告称，GELU 在梯度稳定的情况下达到 98.03% 的 MLP 准确率与 93.82% 的 CNN 准确率。<sup>[12](https://openurl.ebsco.com/fulltext/gcd%3A192718358)</sup>

理论研究也对整流器的声誉提出了限定。用 He 方法初始化、并以梯度下降在最小二乘损失上训练的两层（泄漏）ReLU 网络并非普遍一致：对一类一维数据生成分布，梯度下降以高概率收敛到糟糕的局部极小值，因为它无法将偏置推离零初始化太远。<sup>[13](https://arxiv.org/abs/2002.04861)</sup> 另一方面，整流器网络受梯度消失的影响小于 sigmoid 网络，并已在图像与语音分类中展现出最先进的性能。<sup>[14](https://proceedings.mlr.press/v48/panb16.pdf)</sup>

## 实践中的使用

两大主流框架都将整流器视为一等构建模块。PyTorch 提供 `nn.ReLU` 与函数式 `F.relu`；TensorFlow 的 `tf.keras.layers.ReLU` 通过 `max_value` 上限、负侧的 `negative_slope` 与 `threshold` 对该函数做了推广，因此单个层类即可覆盖 ReLU、泄漏 ReLU 与有界变体。<sup>[6](https://docs.pytorch.org/docs/stable/nn)</sup><sup> • </sup><sup>[7](https://www.tensorflow.org/api_docs/python/tf/keras/layers/ReLU)</sup> 整流器变体之间的选择仍是经验性的：从业者通常在自己的任务上比较准确率与训练成本，因为针对某一架构或数据集报告的增益并不能可靠地迁移。<sup>[8](https://arxiv.org/abs/1710.05941)</sup><sup> • </sup><sup>[3](https://arxiv.org/abs/2104.02523)</sup>

## References

1. [Nair, Vinod and Hinton, Geoffrey E. (2010). Rectified Linear Units Improve Restricted Boltzmann Machines. ICML, pp. 807–814.](https://mlanthology.org/icml/2010/nair2010icml-rectified/)
2. [Glorot, Xavier, Bordes, Antoine, and Bengio, Yoshua (2011). Deep Sparse Rectifier Neural Networks. AISTATS, PMLR 15:315–323.](https://proceedings.mlr.press/v15/glorot11a.html)
3. [Nguyen, Anh, Pham, Khoa, Ngo, Dat, Ngo, Thanh, and Pham, Lam (2021). An Analysis of State-of-the-art Activation Functions For Supervised Deep Neural Network. arXiv:2104.02523.](https://arxiv.org/abs/2104.02523)
4. [He, Kaiming, Zhang, Xiangyu, Ren, Shaoqing, and Sun, Jian (2015). Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. ICCV, pp. 1026–1034.](https://openaccess.thecvf.com/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf)
5. [Lu, Lu, Shin, Yeonjong, Su, Yanhui, and Karniadakis, George Em (2019). Dying ReLU and Initialization: Theory and Numerical Examples. arXiv:1903.06733.](https://arxiv.org/abs/1903.06733)
6. [torch.nn — PyTorch documentation.](https://docs.pytorch.org/docs/stable/nn)
7. [tf.keras.layers.ReLU — TensorFlow v2.16.1 documentation.](https://www.tensorflow.org/api_docs/python/tf/keras/layers/ReLU)
8. [Ramachandran, Prajit, Zoph, Barret, and Le, Quoc V. (2017). Searching for Activation Functions. arXiv:1710.05941.](https://arxiv.org/abs/1710.05941)
9. [Schmidhuber, Jürgen. Annotated history of modern AI and deep neural networks.](https://people.idsia.ch/~juergen/deep-learning-history.html)
10. [Krizhevsky, Alex, Sutskever, Ilya, and Hinton, Geoffrey E. (2012). ImageNet Classification with Deep Convolutional Neural Networks. NIPS 2012.](https://papers.nips.cc/paper_files/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html)
11. [Hendrycks, Dan and Gimpel, Kevin (2016). Gaussian Error Linear Units (GELUs). arXiv:1606.08415.](https://arxiv.org/abs/1606.08415)
12. [Mobarki, Ahmed and Sheikh, Abdullah (2026). Optimizing neural networks: a comparative study of activation functions in deep learning. International Journal of Electrical & Computer Engineering 16(2):945.](https://openurl.ebsco.com/fulltext/gcd%3A192718358)
13. [Tian, Yunwen (2020). Training Two-Layer ReLU Networks with Gradient Descent is Inconsistent. arXiv:2002.04861.](https://arxiv.org/abs/2002.04861)
14. [Pan, Bubacarr and Lederer, James (2016). Expressiveness of Rectifier Networks. ICML, PMLR 48.](https://proceedings.mlr.press/v48/panb16.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › 机器学习与神经计算 › 神经网络与深度学习 › 神经网络概述

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/rectifier-neural-networks

English original: https://www.edgepedia.org/rectifier-neural-networks
