Hello.
I have been able to get through most of the programming assignments quite easily. For the programming assignment of Week 2 for the “Calculus and Machine Learning and Data Science” course (Optimization Using Gradient Descent: Linear Regression), I have been able to solve all of the exercises except one: Exercise 5. Unfortunately, because its results are used for the upcoming exercise, I cannot pass the assignment without completing it. I was able to define the “dEdm” function, but I can’t figure out how to define the “dEdb” function. I used the equations for the partial derivatives provided in the notebook (second screenshot). The main thing I can’t figure out is how to use the “dot()” function of the NumPy module to solve this problem. For dEdm, it’s simple as you just have to include “X” as the second parameter. But, for dEdb, I’m not sure what the second parameter should be. I tried to multiply it by 1 or a NumPy array of 1. I think I should include an identity matrix as the second argument so that the array itself isn’t changed, but I can’t figure out how to make it. Or, maybe I should approach the problem an entirely different way. I’m not sure. Could someone please help me? Thank you.
{moderator edit - solution code removed}
