I have solved this problem. I was writing wrongly the equation for updating the term b
in optimize
function. After correcting it worked. There were no errors. Please do check your code carefully.
5 Likes