Hi, Can anyone guide me what am I doing wrong with my code?
Hello @Syed_Hamza_Tehseen! I hope you are doing well.
First, kindly delete your code as it is against the community Honor Code.
Regarding your error, Python is case-sensitive. The X and x are counted as different, not the same. Check your implementation of z in the propagate
function.
Best,
Saif.
How do I delete the photos?
Secondly, Can you also tell me what’s wrong in my cost calculation?
You can remove the code by clicking the little pencil icon at the bottom of your message, as shown in the below figure:
Regarding the error, in your propagare
function, you are calculating z
by doing dot product between w.T
and x
. Your propagate
function don’t know what is x
. It is case-sensitive.
Best,
Saif.
No, No, I’ve corrected it. I am getting the write dw and db but my cost value is wrong. can you help me in that? Look at my calculations for the cost in my code and tell me what am I doing wrong
Can you share the error, please?
Your implementation of cost in propagate
maybe wrong. Check the equation below:
J=-\frac{1}{m} \sum_{i=1}^{m} \left(y^{(i)}\log(a^{(i)}) + (1-y^{(i)})\log(1-a^{(i)})\right)
Are you implementing it correctly? It is given that “Write your code step by step for the propagation. np.log(), np.dot()”.
So, you have to use np.log for the log part, then have to use np.dot, then sum all, and then multiply the whole term with -\frac{1}{m}.
Best,
Saif.