Planar Data Classification with One Hidden Layer, Programming Assignment, Week3

Exercise 6 : Question about backward_propagation:

I took a look in the test dataset. Shape of X is (2,3) so two features and three examples.

Shape of W1 is (4,2). I take this to mean that we have four neurons. However, for the life of me I cant see where have we defined that the number of neurons is 4 :frowning: Or is it that the number of neurons is the number of rows in W1?

Asking since in exercise 2 we explicitely define layer_size n_h = 4

Note that the test cases here donā€™t have to agree with the ā€œrealā€ dimensions we use in the final model we build. The test case is ā€œself containedā€: they just give you the parameters, which includes all the W and b values. So as you say, the shapes are what they are and you can deduce the number of neurons in each layer from that.