nan – overflow error encountered when running gradient descent

I am constantly encountering these kind of overflow errors in my python code for Gradient Descent Algorithm.

e.g. RuntimeWarning:

overflow encountered in scalar add

RuntimeWarning:

overflow encountered in scalar power

RuntimeWarning:

overflow encountered in scalar multiply

RuntimeWarning:

invalid value encountered in scalar multiply
Overflow error
NaN error occuring because of the overflow error

I tried to typecast the variables to floats ( np.float64(‘variable’)) but sill no result.Can someone provide mme with any solution?

Read more here: Source link