ReLU

term_id: relu

Category: basic_concepts

Definition

由于其计算效率高且能缓解梯度消失问题,ReLU 被广泛应用于深度学习的神经网络中。其数学定义为 f(x) = max(0, x),它引入了非线性特性(原文截断,意为 introduces non-linearity)。

Summary

修正线性单元(ReLU)是一种激活函数,如果输入为正,则直接输出该输入;否则输出零。

Key Concepts

  • 非线性
  • 激活函数
  • 梯度消失
  • 分段线性

Use Cases

  • 卷积神经网络中的隐藏层
  • 深度前馈网络
  • 图像识别模型

Code Example

1
2
import torch.nn as nn
activation = nn.ReLU()