Skip to content

Instantly share code, notes, and snippets.

@rscarrera27
Created August 3, 2017 12:45
Show Gist options
  • Save rscarrera27/6ebfb765f3fb2c3c04f474a3dcbcf978 to your computer and use it in GitHub Desktop.
Save rscarrera27/6ebfb765f3fb2c3c04f474a3dcbcf978 to your computer and use it in GitHub Desktop.
편향을 사용한 AND 퍼셉트론
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