Thanks Tom you’re a life saver. Just as you said I changed the learning rate to 0.1 and everything is fine.

image.png434×710 11.2 KB

Also have dropped the using namespace std and changed iteration number in the original question, thanks again for these great tips. I’m kind a newbie in CPP