Wow. So even your Z1 value is already different, so that throws everything else off. The formula is quite straightforward and what you described sounds correct. Here is the mathematical version of the formula:
Z1 = W1 \cdot X + b1
So how could that go wrong in python? Are you sure you used np.dot for the multiply? But if you tried to use np.multiply or *, it would throw a dimension mismatch, since W1 is 4 x 2 and X is 2 x 3.
I tried a couple of mistakes like not actually adding b1 or multiplying by b1 and that doesn’t give me the same bad values that you show. Maybe somehow the test case code is different. Try printing W1, X and b1. Here’s what I see:
W1 = [[-0.00416758 -0.00056267]
[-0.02136196 0.01640271]
[-0.01793436 -0.00841747]
[ 0.00502881 -0.01245288]]
X = [[ 1.62434536 -0.61175641 -0.52817175]
[-1.07296862 0.86540763 -2.3015387 ]]
b1 = [[ 1.74481176]
[-0.7612069 ]
[ 0.3190391 ]
[-0.24937038]]
Z1 = [[ 1.7386459 1.74687437 1.74830797]
[-0.81350569 -0.73394355 -0.78767559]
[ 0.29893918 0.32272601 0.34788465]
[-0.2278403 -0.2632236 -0.22336567]]