def sigmoid(z): return 1./(1+np.exp(-z)) def ReLU(z): return np.maximum(0,z) z = np.linspace(-10,10,100) plt.plot(z, sigmoid(z),'r', label = 'sigmoid') plt.plot(z, ReLU(z),'b',label ='ReLU') plt.legend(fontsize=12)
<matplotlib.legend.Legend at 0x20209d42b38>