Skip to content

Instantly share code, notes, and snippets.

@jjone36
Last active December 28, 2018 08:31
Show Gist options
  • Save jjone36/c80b5d5df7b72c9b4d5aa3587e16abe8 to your computer and use it in GitHub Desktop.
Save jjone36/c80b5d5df7b72c9b4d5aa3587e16abe8 to your computer and use it in GitHub Desktop.
import numpy as np
# input data
input_layer = np.array([[5], [2]])
input_layer.shape
# initialize wegihts & bias
weights_1 = np.array([[2, -2], [3, 1]])
weights_1.shape
weights_2 = np.array([[1], [2]])
weights_2.shape
# computation
node_0_output = np.dot(weights_1.T, input_layer)
node_1_input = node_0_output
node_1_output = np.dot(weights_2.T, node_1_input)
output_layer = node_1_output
# print output_layer
output_layer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment