Hello! I’ve been stuck for a while, so I hope you geniuses out there can help me
In the def compute_model_output(x, w, b) function (pic 1), I am quite confused about why we are using m = x.shape[0], not m = x_train.shape[0]? We literally JUST initiated x in the def(), so where would the program find “the shape of x” to assign to m? In the lines preceding it, we had defined the array as x_train = np.array([1.0, 2.0]), so x_train.shape[0] seems to more sense to me.
Can someone let me know what I’m missing? Thanks a bunch!
I think you need some python classes to undestand how coding and more specifically python works.
When you build a a function in python;
def my_function(arg1, arg2, arg3…)
the variables used within the definition and in the body of the function, are just mock ups that will later store the parameters that you feed when you initiate the function itself i.e.