C1_W3_Ex2 query

Getting unexpected output

you should compute the equation z = x*w+b
then calculate the sigmoid for z
then substitute in this equation π‘™π‘œπ‘ π‘ (𝑓𝐰,𝑏(𝐱(𝑖)),𝑦(𝑖))=(βˆ’π‘¦(𝑖)log(𝑓𝐰,𝑏(𝐱(𝑖)))βˆ’(1βˆ’π‘¦(𝑖))log(1βˆ’π‘“π°,𝑏(𝐱(𝑖)))
and repeat this for each element in x and add all of these to the cost

did you calculate the loss like this?

Hi @Harikesh_Kumar,

Not getting expected output is a sign of incorrect implementation of the exercise, but that is not uncommon in learners’ first trial in any exercise. I would suggest you to follow this general code debugging tips so that you can keep track of the progress of your code and see which line doesn’t work to your expectation.

As @Osama_Saad_Farouk pointed out, it’s important we make sure the code is implemented in the right way, and following my tips will help you make sure it that way.

Cheers,
Raymond

Hi - I sent you a message with the details

1 Like