只有0和1两种取值
只有当信号总和超过某个界限的时候,神经元才会被激活
不同的权重对应的信号的重要性越高
使用感知机就可以表示这三种门电路
三个门电路只有权重和阈值不同
相同的感知机,可以通过调整不同的参数,来扮演不同的角色
def AND(x1, x2):
w1, w2, theta = 0.5, 0.5, 0.7
temp = x1 * w1 + x2 * w2
if temp < theta:
print("the out is 0")
elif temp > theta:
print("the out is 1")
AND(1, 1)

参数B表示偏置
def AND(x1, x2):
x = np.array([x1, x2])
w = np.array([0.5, 0.5])
b = -0.7
temp = np.sum(x * w) + b
if temp <= 0:
print('the out is 0')
else:
print('the out is 1')
矩阵来实现不同路径上权重之和