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
+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