如何在不使用Tensorflow的情况下在Python中实现Leaky ReLU的派生类?
有没有比这更好的方法了?我希望函数返回一个numpy数组
def dlrelu(x, alpha=.01):
# return alpha if x < 0 else 1
return np.array ([1 if i >= 0 else alpha for i in x])
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助