Skip to content

Instantly share code, notes, and snippets.

@cacapon
Last active May 18, 2021 02:09
Show Gist options
  • Save cacapon/9e5f9711fe2c87db575926bbce9f5032 to your computer and use it in GitHub Desktop.
Save cacapon/9e5f9711fe2c87db575926bbce9f5032 to your computer and use it in GitHub Desktop.
ANDゲートをパーセプトロンの原理に基づいて作成したもの
def AND(x1, x2):
# 引数は0 or 1 を想定しています。
w1,w2,theta = 0.5,0.5,0.7
tmp = x1*w1 + x2*w2
if tmp <= theta:
return 0
else:
return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment