Basic questions: week 3 - ex. 1 & 2

Hi @Kic ,
Sorry for the basic questions…
In exervise 1 of week 3,
X.shape was (2, 400)
Y.shape was (1, 400)

Now in exervise 2,
X.shape is (5. 3)
Y.shape is (2,3)

My question is:
Where did function layer_sizes(X, Y) get the data from? I mean, for exercise 1 we downloaded the dataset from the cell X, Y = load_planar_dataset() But how did the function return correctly the new values n_x = 5 and n_y = 2 if no dataset was downloaded?

  1. When you say “hardcode” (the hidden layer size), do you mean"set a variable to an explicit number, that is not computed by any other function?

Thank you for the trouble. We have an ancient proverb: “One who is shy (avoiding asking questions) can never learn.”

Hi @Doron_Modan ,

I like your metaphor. Learning shouldn’t just limit to early stages of our lives, but continuous. I can see you are keen to learn, so for that reason, I think you would be benefited to pause this course and enrol to the Machine Learning Specialisation instead. This MLS is for beginners level, with lots of optional labs to bring up the level of python and concepts used in the specialization, and they are well written. If you do that and also take up a course on programming, you will find that when you return to DLS, you would understand and appreciate the lecture contents and assignments better.

In regards to your question on ‘hardcode’, yes, your understanding of what I meant is correct.
For ex2, the X, and Y are input parameters of the functionn layer_sizes(X,Y) , please read the comments at the start of the function, it explains what input and output parameters are. The value of X and the value of Y are passed to layer_sizes() when it is called. You can see that from the cell below, where
t_X, t_Y = layer_sizes_test_case(), - getting the X and Y values
followed by
(n_x, n_h, n_y) = layer_sizes(t_X, t_Y) - passing the values t_x, t_Y to layer_sizes()
layer_sizes_test(layer_sizes) - calling the test to test the layer_sizes

This cell is for testing the layer_sizes() function. Whenever you see a cell with something ended with test_case, they are there to test your function. They are there to give you some confidence whether your code is working, such that when you integrate all these functions later on, you would know what works and work doesn’t.

I hope this help, and keep learning!