多层感知机(MLP)实现异或(XOR)操作

多层感知机(MLP)实现异或(XOR)操作

1.图中元素说明

(a)输入层和隐层之间灰色箭头的权重均为+1;其他箭头表示的权重标在箭头旁边。
(b)圆圈中的阶梯符号表示函数:
多层感知机(MLP)实现异或(XOR)操作

2. 验证满足XOR运算

(a)当输入 (x1,x2)=(0,0)时:

隐层左perception输出为heaviside(-1.5+1×0+1×0)=0;
隐层右perception输出为heaviside(-0.5+1×0+1×0)=0;
输出层perception输出为heaviside(-0.5+(-1)×0+1×0)=0。
MLP输出0。

(b)当输入 (x1,x2)=(1,1)时:

隐层左perception输出为heaviside(-1.5+1×1+1×1)=1;
隐层右perception输出为heaviside(-0.5+1×1+1×1)=1;
输出层perception输出为heaviside(-0.5+(-1)×1+1×1)=0。
MLP输出0。

(c)当输入 (x1,x2)=(0,1)时:

隐层左perception输出为heaviside(-1.5+1×0+1×1)=0;
隐层右perception输出为heaviside(-0.5+1×0+1×1)=1;
输出层perception输出为heaviside(-0.5+(-1)×0+1×1)=1。
MLP输出1。

(d)当输入 (x1,x2)=(1,0)时:

隐层左perception输出为heaviside(-1.5+1×1+1×0)=0;
隐层右perception输出为heaviside(-0.5+1×1+1×0)=1;
输出层perception输出为heaviside(-0.5+(-1)×0+1×1)=1。
MLP输出1。