Skip to content

Instantly share code, notes, and snippets.

@Muhammad-Yunus
Created April 10, 2020 07:19
Show Gist options
  • Save Muhammad-Yunus/037b0ffdd2d606e454711e1f498bf66c to your computer and use it in GitHub Desktop.
Save Muhammad-Yunus/037b0ffdd2d606e454711e1f498bf66c to your computer and use it in GitHub Desktop.
Single Layer Perceptron - logic AND (test)
#test
x_test = [[0,0],[0,1],[1,0],[1,1]]
for x_test_item in x_test :
y_test = np.dot(x_test_item, W) + b
y_test = 1 if y_test > 0 else 0
print(str(x_test_item[0]) + ' AND ' + str(x_test_item[1]) + ' = ' + str(y_test))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment