python-small-examples/md/1.md at master · data-python/python-small-examples

Skip to content

Navigation Menu

Sign in

Appearance settings

Latest commit

File metadata and controls

27 lines (20 loc) · 408 Bytes

@author jackzhenguo
@desc 实现 relu
@date 2019/2/10

1 实现 relu

在神经网络中,relu作为神经元的激活函数:

def relu(x):
    """
    x: 输入参数
    return:输出relu值
    """
    return max(0,x)                                                                 

测试: