Last active
May 18, 2021 02:09
-
-
Save cacapon/9e5f9711fe2c87db575926bbce9f5032 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): | |
# 引数は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