Building a Neural Network from scratch in python with just Numpy and maths. Link to colab notebook: https://colab.research.google.com/drive/1uzdhvDRVAgCURUl2lOY_ISkUv-_bNFiE
The NN has a simple two-layer architecture. Input layer
Forward propagation
Backward propagation
Parameter updates
Vars and shapes
Forward prop
-
$A^{[0]} = X$ : 784 x m -
$Z^{[1]} \sim A^{[1]}$ : 10 x m -
$W^{[1]}$ : 10 x 784 (as$W^{[1]} A^{[0]} \sim Z^{[1]}$ ) -
$B^{[1]}$ : 10 x 1 -
$Z^{[2]} \sim A^{[2]}$ : 10 x m -
$W^{[1]}$ : 10 x 10 (as$W^{[2]} A^{[1]} \sim Z^{[2]}$ ) -
$B^{[2]}$ : 10 x 1
Backprop
-
$dZ^{[2]}$ : 10 x m ($~A^{[2]}$ ) -
$dW^{[2]}$ : 10 x 10 -
$dB^{[2]}$ : 10 x 1 -
$dZ^{[1]}$ : 10 x m ($~A^{[1]}$ ) -
$dW^{[1]}$ : 10 x 10 -
$dB^{[1]}$ : 10 x 1