M4ML C2-W2 Assigment Exercise 6 issues with unsupported operand types

I am having issues implementing the gradient descent formula in Exercise 6.

The error is as follows:

TypeError: unsupported operand type(s) for *: ‘float’ and ‘function’

Could you provide some hints as to how to solve this? I think this is more to do with Python than the understanding of the math. So I would appreciate if I could be pointed more explicitly in the right direction.

Thank you.

Im not familiar with this course but what the error says is that you are trying to multiply a function with a float number.

It might be possible that first you need to call that function and assign its output to a variable and thats probably done in the previous cells.

Thanks, I managed to figure it out. My coding skills are certainly improving throughout this process.

Hello Hooi Yau Ming.

For me it worked in this way. I added variables after dEdm.

@Agnese Very good! Now you are helping!
@yauhooi1 You have the same issue shown here:

As @Agnese suggested you need to call the function with the parenthesis and pass the parameters. Refer to the answer I sent on the other post.

Thanks, Agnese, I managed to figure that out not long after I wrote to you for help. I guess it shows that the math and coding are similar but not the same - almost as if learning two similar languages.

Thanks @yjcb22 I managed to figure it out not long after I started asking for help. I guess with time I will become better at coding.