Deep Learning, Python, Data Science, Programming, Neural Networks.
Function alpha = 0.01 leaky_relu_output = np.where(z > 0, z, alpha * z) plt.plot(z, leaky_relu_output) plt.title('Leaky ReLU Function') plt.xlabel('z') plt.ylabel('Leaky ReLU(z)') plt.grid(True) plt.savefig('leaky_relu_function.png') plt.close() Plot: Equivalent Command in Pytorch: import torch