Created
March 28, 2020 13:35
-
-
Save SnowyPainter/7a1bc277a791f7e9281c3c0d8aa137ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pylab as plt | |
def step(x): | |
return np.array(x > 0, dtype=np.int) | |
def sigmoid(x): | |
return 1/(1+1/np.exp(x)) | |
def relu(x): | |
return np.maximum(0, x) | |
x = np.arange(-5,5,0.1) | |
y = relu(x) | |
plt.plot(x,y) | |
plt.ylim(-0.1,5.0) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment