Skip to content

Instantly share code, notes, and snippets.

@SnowyPainter
Created March 28, 2020 13:35
Show Gist options
  • Save SnowyPainter/7a1bc277a791f7e9281c3c0d8aa137ff to your computer and use it in GitHub Desktop.
Save SnowyPainter/7a1bc277a791f7e9281c3c0d8aa137ff to your computer and use it in GitHub Desktop.
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