[Minor Feedback?] 2D Matrix Name within the Lab

When creating a post, please add:

  • Week #1
  • Link to the classroom item you are referring to:

Link: Coursera | Online Courses & Credentials From Top Educators. Join for Free | Coursera

Quiz: UNQ_C3

  • Description (include relevant info but please do not post solution code or your entire notebook):

I know it is the engineer’s duty to decide the name of the variables, but to make the code consistency, and also like Professor explained within the lecture, I think we should use B instead of b for the 2D Array input bias. I was little confused first time, because it was lower case, which gave me questions like “is it the question to transform 1d vector bias to 2d within the function, and then I need to use 2D to call the mutmul?”

There were very good explainations about the inputs, so I was able to figure out that even though it’s lower case, it is 2D Matrix, b.

However, to make removing those confusion, I think we need to fix like below:



def my_dense_v(A_in, W, B, g):
Computes dense layer
A_in (ndarray (m,n)) : Data, m examples, n features each
W (ndarray (n,j)) : Weight matrix, n features per unit, j units
B (ndarray (1,j)) : bias vector, j units
g activation function (e.g. sigmoid, relu…)
A_out (tf.Tensor or ndarray (m,j)) : m examples, j units
# solution

Please correct me, if I am wrong! I could be misunderstood.

I see your point.

However, it’s traditional for the bias to be referred to as ‘b’, regardless of the size of the variable (scalar or vector).

Making that change in this assignment would mean updating every machine learning course ever published.

Consistency is a worthy goal, but not always used in practice.

1 Like

Got it :slight_smile:
Thank you so much for your reply!