tanh,relu,sigmoid激活函數numpy實現

from matplotlib import pyplot as pl x=np.arange(-5,5,0.01) #Relu y1=np.where(x>0,x,0) pl.plot(x,y1) pl.show() y2=(x+np.abs(x))/2 pl.plot(x,y2) pl.show() y3=np.maximum(x,0) pl.plot(x,y3) pl.show()
相關文章
相關標籤/搜索