Created
April 10, 2020 07:41
-
-
Save Muhammad-Yunus/a93867b4fa325513dd282aca4131fce2 to your computer and use it in GitHub Desktop.
Single Laer Perceptron - Logic AND (plot lineary sparable class)
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
# plot lineary separable class (logic AND) | |
plot_x = np.array([np.min(x[:, 0] - 0.2), np.max(x[:, 1]+0.2)]) | |
plot_y = - 1 / W[1] * (W[0] * plot_x + b) | |
print('W:' + str(W)) | |
print('b:' + str(b)) | |
print('plot_y: '+ str(plot_y)) | |
plt.scatter(x[:, 0], x[:, 1], c=y, s=100, cmap='viridis') | |
plt.plot(plot_x, plot_y, color='k', linewidth=2) | |
plt.xlim([-0.2, 1.2]); plt.ylim([-0.2, 1.25]); | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment