Where in the course do I find this?

The following information comes from the Practice lab on C2 W1 assignment. I need to better understand how the dimensions of W and b are determined. Can someone explain this to me please? Or point me to the video in the course where it is explained?


The parameters have dimensions that are sized for a neural network with 25 units in layer 1, 15units in layer 2 and 1 output unit in layer 3.

  • Recall that the dimensions of these parameters are determined as follows:
    • If network has 𝑠𝑖𝑛 units in a layer and π‘ π‘œπ‘’π‘‘ units in the next layer, then
      • π‘Š will be of dimension π‘ π‘–π‘›Γ—π‘ π‘œπ‘’π‘‘.
      • 𝑏 will a vector with π‘ π‘œπ‘’π‘‘ elements

For each pair of adjacent layers, there is a weight matrix β€˜W’ and a bias vector β€˜b’. They serve to connect the adjacent layers.

The size of the β€˜W’ matrix is typically (outputs x inputs) - giving the number of rows and columns.

  • The β€œoutputs” are the number of units in the next layer.
  • The β€œinputs” are the number of units in the previous layer.

Note that this isn’t a concrete rule - the shape of the W matrix depends on the designer of the model.

For each unit in the previous layer, there is a value in the β€˜b’ vector. So typically the shape is (inputs x 1). Though it could also be (1 x inputs), again depending on the designer of the model.