This commit is contained in:
Morten Hjorth-Jensen
2021-10-14 11:17:29 +02:00
parent 1605d87b70
commit aee516dd4a
7 changed files with 6 additions and 2 deletions
+1
View File
@@ -358,6 +358,7 @@ $$
1 & 1 \end{bmatrix},
$$
<p>
while the vector of outputs is \( \boldsymbol{y}^T=[0,1,1,0] \) for the XOR gate, \( \boldsymbol{y}^T=[0,0,0,1] \) for the AND gate and \( \boldsymbol{y}^T=[0,1,1,1] \) for the OR gate.
<p>
+1
View File
@@ -1543,6 +1543,7 @@ $$
$$
<p>&nbsp;<br>
<p>
while the vector of outputs is \( \boldsymbol{y}^T=[0,1,1,0] \) for the XOR gate, \( \boldsymbol{y}^T=[0,0,0,1] \) for the AND gate and \( \boldsymbol{y}^T=[0,1,1,1] \) for the OR gate.
</section>
@@ -1552,6 +1552,7 @@ $$
1 & 1 \end{bmatrix},
$$
<p>
while the vector of outputs is \( \boldsymbol{y}^T=[0,1,1,0] \) for the XOR gate, \( \boldsymbol{y}^T=[0,0,0,1] \) for the AND gate and \( \boldsymbol{y}^T=[0,1,1,1] \) for the OR gate.
<p>
+1
View File
@@ -1557,6 +1557,7 @@ $$
1 & 1 \end{bmatrix},
$$
<p>
while the vector of outputs is \( \boldsymbol{y}^T=[0,1,1,0] \) for the XOR gate, \( \boldsymbol{y}^T=[0,0,0,1] \) for the AND gate and \( \boldsymbol{y}^T=[0,1,1,1] \) for the OR gate.
<p>
Binary file not shown.
-1
View File
@@ -1555,7 +1555,6 @@
},
"outputs": [],
"source": [
"\n",
"# import necessary packages\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
+2 -1
View File
@@ -1120,6 +1120,7 @@ Our design matrix is defined by the input values $x_1$ and $x_2$. Since we have
1 & 0 \\
1 & 1 \end{bmatrix},
!et
while the vector of outputs is $\bm{y}^T=[0,1,1,0]$ for the XOR gate, $\bm{y}^T=[0,0,0,1]$ for the AND gate and $\bm{y}^T=[0,1,1,1]$ for the OR gate.
!split
@@ -1195,13 +1196,13 @@ predictions = predict(X)
print(predictions)
!ec
Not an impressive result, but this was our first forward pass with randomly assigned weights. Let us now add the full network with the back-propagation algorithm discussed above.
!split
===== The Code using Scikit-Learn =====
!bc pycod
# import necessary packages
import numpy as np
import matplotlib.pyplot as plt