You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\Users\debax\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/debax/Desktop/node/linear.py
C:/Users/debax/Desktop/node/linear.py:39: RuntimeWarning: overflow encountered in double_scalars
b_gradient+=((2/N)(-x(y-(cur_mx+cur_b))))
after 1000 iterations:
nan
nan
C:/Users/debax/Desktop/node/linear.py:41: RuntimeWarning: invalid value encountered in double_scalars
new_b=cur_b-(learning_rateb_gradient)
C:/Users/debax/Desktop/node/linear.py:42: RuntimeWarning: invalid value encountered in double_scalars
new_m=cur_m-(learning_rate*b_gradient)
Process finished with exit code 0
The text was updated successfully, but these errors were encountered:
Hi Franken,
If you're using some real non scaled data like me then you'll be facing that problem.
In lines 23, 24
b_gradient += (-2/N) * (y - ((m_current * x) + b_current))
m_gradient += (-2/N) * x * (y - ((m_current * x) + b_current))
the gradient values are increasing each time with such great quantities because of the large real values stored in the variables x and y. Hence both b_gradient and m_gradient will not be sufficient in order to have such large values stored inside them even if you converted then into int64.
So, in order to solve such a problem,
you'll need to scale your data set values so they would range in between 1 and -1 or any other small values.
Hi Franken,
If you're using some real non scaled data like me then you'll be facing that problem.
In lines 23, 24
b_gradient += (-2/N) * (y - ((m_current * x) + b_current))
m_gradient += (-2/N) * x * (y - ((m_current * x) + b_current))
the gradient values are increasing each time with such great quantities because of the large real values stored in the variables x and y. Hence both b_gradient and m_gradient will not be sufficient in order to have such large values stored inside them even if you converted then into int64.
So, in order to solve such a problem,
you'll need to scale your data set values so they would range in between 1 and -1 or any other small values.
C:\Users\debax\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/debax/Desktop/node/linear.py
C:/Users/debax/Desktop/node/linear.py:39: RuntimeWarning: overflow encountered in double_scalars
b_gradient+=((2/N)(-x(y-(cur_mx+cur_b))))
after 1000 iterations:
nan
nan
C:/Users/debax/Desktop/node/linear.py:41: RuntimeWarning: invalid value encountered in double_scalars
new_b=cur_b-(learning_rateb_gradient)
C:/Users/debax/Desktop/node/linear.py:42: RuntimeWarning: invalid value encountered in double_scalars
new_m=cur_m-(learning_rate*b_gradient)
Process finished with exit code 0
The text was updated successfully, but these errors were encountered: