Created
August 3, 2017 12:45
-
-
Save rscarrera27/6ebfb765f3fb2c3c04f474a3dcbcf978 to your computer and use it in GitHub Desktop.
편향을 사용한 AND 퍼셉트론
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
def AND(x1, x2): | |
x = np.array([x1, x2]) | |
w = np.array([0.5, 0.5]) | |
b = -0.7 | |
tmp = np.sum(w*x) + b | |
if tmp <= 0: | |
return 0 | |
else: | |
return 1 | |
AND(1, 0) #0 | |
AND(1, 1) #1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment