To gain a better understanding of how neural networks work, we will formulate the preceding architecture and forward propagation computations using matrix algebra and implement it using NumPy, the Python counterpart of linear algebra.
How to build a neural network using Python
The input layer
The preceding architecture is designed for two-dimensional input data, X, which represent two different classes, Y. In matrix form, both X and Y are of shape N x 2, as follows:
We will generate 50,000 random samples in the form of two concentric circles with different radii using scikit-learn's make_circles function so that the classes are not linearly separable, as follows:
N = 50000
factor = 0.1
noise = 0.1
X, y = make_circles(n_samples...