For C2_w1_lab02_CoffeeRoasting_TF, what does the shape = (2,) refer to? was it referring to 2 features in layer 0?
Thank you!
For C2_w1_lab02_CoffeeRoasting_TF, what does the shape = (2,) refer to? was it referring to 2 features in layer 0?
Thank you!
Hi @aprilguoguo2, Thanks for your post.
Well when you pass tf.keras.Input(shape=(2,))
as the first layer in a sequential model, you are telling the model that the input data will have a shape of (None, 2)
, where None
represents a flexible batch size (it can be any size, and the model will automatically adapt to it) and 2
represents the size of the second dimension, which is 2 in this case.
The shape (None, 2)
means that the input data is expected to be two-dimensional. The second dimension, represented by 2
, specifies that each input sample must have a size of 2 in the second dimension. For example, if you are working with data points in a 2D space, each input sample would have two features.
I hope this helps you and feel free to ask for more clarification
Best Regards,
Jamal
Hi Jamal,
I have a related question on the shape value in this lab.
for this: print(f"W1{W1.shape}:\n", W1, f"\nb1{b1.shape}:", b1), why the result of W1.shape is: (2, 3) not (3, 2)? in this case we have 3 units in a layer (number of rows, first dimension) and each unit has 2 features (number of columns, second dimension).
Thanks!
William
There is little standardization on the format of a weight matrix. You can always transpose the w matrix so the dimensions match.
thanks!