Skip to content

Instantly share code, notes, and snippets.

@lucifermorningstar1305
Created January 13, 2019 16:02
Show Gist options
  • Save lucifermorningstar1305/0ec013c0a40979bd6d2bd41affce9b1d to your computer and use it in GitHub Desktop.
Save lucifermorningstar1305/0ec013c0a40979bd6d2bd41affce9b1d to your computer and use it in GitHub Desktop.
activation_function = lambda x: 1.0/(1.0 + np.exp(-x))
input = np.random.randn(3,1)
W1 = np.random.randn(None, 1)
W2 = np.random.randn(None,1)
W3 = np.random.randn(None,1)
b1 = np.zeros(1)
b2 = np.zeros(1)
b3 = np.zeros(1)
hidden_1 = activation(np.dot(W1, input) + b1)
hidden_2 = activation(np.dot(W2, W1) + b2)
output = np.dot(W3, W2) + b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment