This course introduces the Gradient Descent to find the optimal values of the weights and the bias. Watch this video for Andrew’s explanation of the detailed steps.
Have you watched the lecture that Raymond linked that explains how Gradient Descent is used to learn the weights (the w_i and b values)? If you still have doubts, please ask some questions about what is unclear to you so that we can discuss further. That’s the perfect application for the forum discussions, but in order to make progress, we need a more specific question than “I have doubts” to get started with the discussion.
Actually it looks like the link Raymond gave was to the Coursera version of the course, but you’ve labeled this thread for the DeepLearning.AI version of the course. Here’s the same lecture Raymond is referencing, but in MLS C1 W2 on the DLAI LP. Please use the appropriate link, depending on which platform you are using to take MLS.
ii. update the value of the weight using the gradient descent formula (@ 2:05):
Repeat step 2 and step 3 until the cost value is converged.
If you have questions about these steps, please point out which step has a problem and you might as well share your understanding so we could better know how we could align the explanation.
The weights start off as random, and then subsequently they are calculated using the update formula in my above step 3(ii).
For example, W1 may initially be randomized to be 0.234, or 0.111, or -0.00123. Then, the job of gradient descent is to guide (calculate) it towards its optimal value. In the case of multiple linear regression, generally speaking, there is only one optimal value (under certain condition there can also be more than one but I have omitted it from this response because such condition is unlikely meant to be met), which means that with a proper learning rate (not too large), W1 will finally converge to that unique optimal value regardless of its initial value.
However, if it were not multiple linear regression, but a non-linear one, there wouldn’t be just one optimal value, so a different initial value may lead it to a different optimal value.
I think this answers your question 1. For your question 2, you might further expand it to cover more details, but so far I think you have roughly captured the idea quite well!
Raymond’s explanations are great. The only thing I’d add for your question 2) is to make the point that all the gradient descent calculations and updating of weights (including the full number of iterations required to get to the optimal solution that Raymond mentioned) happens within that call to model.fit(). That one function call covers a lot of action.