update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user