Loss Function Sign Question

Hi,

I have a question, in the video from “Lesson 1: Classification with Perceptron: Gradient Descent”, the Loss Function is as shown below (check the red arrow: there is a minus “-” sign.

But, on the C2_W3_Lab_2 you write the function as follows (check the red arrow, there is a plus “+” sign.

Which one is correct for the Loss Function?

Thanks.
BR

Both terms in the expression on the slide are negative (subtraction). If you factor that forward, and put it all the way to the beginning, don’t you arrive at the expression pasted from the lab?

Hello @Bruno_Robles

Did you notice that there is a - 1/m in the 2nd case. The “-” has been taken out from both the terms in the equation and placed outside.

Hi @shanup & @ai_curious ,

Yes, I did not see the “-1/m”, it is 3am where I am, I’m a little tired. I supposed that the “1/m” is for normalizing the entire function.

Thanks both.

1 Like