Hello,
I tried implementing logistic regression in the project and obtained this:
RuntimeWarning: invalid value encountered in double_scalars if len(losses) > 1 and np.abs(losses[-1] - losses[-2]) < threshold:
I didn't get such an error in the lab and am not sure how to resolve it.
Thank you for your help
Probably means that you have NaN or Inf values.
NaN
Inf
This might help: https://stackoverflow.com/questions/37651803/runtimewarning-invalid-value-encountered-in-greater
Thank you for your reply, But what would cause a NaN or Inf value returned as a loss? How should it be interpreted for stopping criterion?
Check out this related post: http://oknoname.herokuapp.com/forum/topic/212/loss-exploding-after-few-iterations/
RuntimeWarning using Logistic Regression
Hello,
I tried implementing logistic regression in the project and obtained this:
I didn't get such an error in the lab and am not sure how to resolve it.
Thank you for your help
Probably means that you have
NaN
orInf
values.This might help: https://stackoverflow.com/questions/37651803/runtimewarning-invalid-value-encountered-in-greater
Thank you for your reply,
But what would cause a NaN or Inf value returned as a loss? How should it be interpreted for stopping criterion?
Check out this related post: http://oknoname.herokuapp.com/forum/topic/212/loss-exploding-after-few-iterations/
Add comment