Doubt regarding loss value

hi
I have used same code as told by instructor but my loss value is not getting reduced much initially it’s 0.3584 & in 500th epoch it’s 0.3404 but instructor is getting loss reduced to almost 0. hence my loss graph is also not uniform like the one of instructor.My loss’s graph is showing a drastic decrease then a reducing curve. So help me out maybe I have made some mistake while coding, So I can share my python file if u want it in chat

I have also written code shown in next video, so accuracy is getting printed in a distorted manner(multiple times with distorted values). So I’m sure I have done some mistake while typing code but I’m not able to find it. I’m sharing with you ipynb file via google drive link so please check for the errors and help me out https://drive.google.com/file/d/1EBexipQnmVO1bjL7kquxE-BldyKp2QMN/view?usp=sharing

Hi,
I’m trying to debug your code. Give me some time
Will let you know asap,

Thanks
- Mohit

ok thank you so much…

HI,

I checked your code, It seems fine. because I tried on multiple datasets and the results coming out to be around 98% for all type of toy non-linear datasets. just try to increase the number of epochs and reduce the learning rate for the better results
Even if you see the spikes on the loss graph that is fine, don’t worry about that, the only thing you should concern is the decision boundary and the score, your model is giving on the non-linear dataset.

If you need my notebook that I’ve tried - a better version just let me know. Otherwise, your code is working fine as well.

Thanks
- Mohit

I’ve tried it on XOR data set also, I kepy learning rate=0.00001 & epochs=1000, loss graph is giving a linear curve for it(i.e a straight line with negative slope). Decision boundary is also not as we require and accuracy is worst i.e 53% … So it will be convenient if you share your jupyter file with me(ipynb)… Please share with me soon because this small thing has taken a lot of my time… Thank You

Very strange, When I tried your code on XOR data, it perfectly worked in my case.

Here’s the link for my notebook: https://drive.google.com/file/d/10nD2Yxl_AwhK9klg0nZSE0mqHI1oO5yx/view?usp=sharing

Thanks,

yes you are right its quite strange because yesterday also I’ve spent ample amount of time to debug but could not find any error…Do you think this problem is due to pip version, because I had installed just jupyter via pip for python 3(not jupyter lab)… Can you suggest me which interface/software should I use for jupyter , jupyter lab etc etc ?? for ML tasks

This shouldn’t be because of jupyter could be any reason.
But, I use jupyter notebook only, that comes preinstalled with anaconda distribution.

I have tried your jupyter file it’s working perfectly fine and decision boundary is also perfect… thank you :stuck_out_tongue:

Great, Even I’ve compared your code with mine, and both are similar, and your code was working fine as well at least for me.

So hopefully look at my code and experiment with that.

Thanks,

ok I’ll do that…now I’m marking it as resolved … Thank You

1 Like