Course 1: Week 2: Binary Classification X.shape convention

Course 1: Week 2: Binary Classification X.shape convention
Here in video it show,
X.shape = (nx, m)
But shouldn’t it be,
X.shape = (m, nx)
As it will output, (row, columns)
i.e (10000, 8)

Same for the Y.shape
Shouldn’t it be,
Y.shape = (m, 1)
OR
Y.shape = (10000, 1)

Hi @kdsharmaai, for coding practice, Prof Ng has used the common math notation m x n, where ‘m’ is the number of rows and ‘n’ is the number of columns. But in the later exercises, Prof Ng has used ‘m’ to represent the ‘number of training examples’, and each training example is in its own column of the matrix. Also, each feature will be in its own row (each row has data for the same feature). Thanks.

Is that what you meant to say here? I don’t think that is the convention used in any of the DLAI courses

That is actually the convention that Prof Ng uses in Course 1, where the inputs are 2D: he makes the “samples” dimension the second dimension. But as soon as we get to higher dimensional arrays in Course 4 and onward, then he uses the more standard convention that the samples dimension is the first dimension.

Of course we actually have 4D images as our inputs in Week 2 and Week 4 of Course 1 with the normal “samples first, channels last” arrangement, so we have to “flatten” those into 2D arrays with the dimensions @Rashmi has described. That requires some care, as detailed on this thread.

Thanks for the clarification. It’s almost 5 years since I took DLS Course 1…maybe I should rewatch some of those early videos and refresh my ‘cache’ :slight_smile: