Kernel: Python 2 (SageMath)
In [99]:
In [100]:
1
In [101]:
0
In [102]:
1
In [103]:
In [104]:
[(array([0, 0, 1]), 0),
(array([0, 1, 1]), 1),
(array([1, 0, 1]), 1),
(array([1, 1, 1]), 1)]
In [105]:
[(array([0, 0, 1]), 0),
(array([0, 1, 1]), 0),
(array([1, 0, 1]), 0),
(array([1, 1, 1]), 1)]
In [106]:
OR weights (random number array) [ 0.8014153 0.8160564 0.69702759]
AND weights(random number array) [ 0.80838801 0.19442953 0.16959215]
In [107]:
In [108]:
OR: (array([0, 0, 1]), 0)
AND: (array([1, 1, 1]), 1)
[ 0.8014153 0.8160564 0.69702759]
[ 0.80838801 0.19442953 0.16959215]
In [109]:
In [110]:
Results for logical OR
Logical Input: [0 0]
Update Weight: -0.00297240662151
Logical Result: 0
Logical Input: [0 1]
Update Weight: 0.813083995874
Logical Result: 1
Logical Input: [1 0]
Update Weight: 0.798442892002
Logical Result: 1
Logical Input: [1 1]
Update Weight: 1.6144992945
Logical Result: 1
Results for logical AND
Logical Input: [0 0]
Update Weight: -0.530407845884
Logical Result: 0
Logical Input: [0 1]
Update Weight: -0.335978318098
Logical Result: 0
Logical Input: [1 0]
Update Weight: -0.122019832266
Logical Result: 0
Logical Input: [1 1]
Update Weight: 0.0724096955205
Logical Result: 1