ReLU(Rectified Linear Unit)是一种常用的激活函数,其计算公式为:

其中,是输入。 该算法是深度学习中常用的激活函数之一。

标准代码如下

def relu(z: float) -> float:
    return max(0, z)