-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Still an infinite loop in bisect #11
Comments
I am happy to accept a PR, but I would just make a separate branch in the |
Hi, it seems I have exactly the same issue and in my case it would be useful if the optimizer returned something (e.g., just an initial guess x_0). Is there some simple way to force it to stop bisecting after a few attempts and give up (just returning an initial condition)? |
I will try to look at this soon; the linesearch logic should be changed somewhat to allow for a graceful return indeed. |
out of curiosity, is there a small minimal example somewhere of bisect looping? |
Oh, I am afraid not really right now. I am developing an MPS-like architecture for image classification and when I optimize MPS tensors one by one, sometimes optimizations just gets stuck on some tensor and does not proceed to the next tensors. |
Hi, if I just download OptimKit.jl and then add this condition
I get this error: |
One hack is just to do using OptimKit
@eval OptimKit function bisect(iter::HagerZhangLineSearchIterator, a::LineSearchPoint, b::LineSearchPoint)
# modified body here...
end Another is you could |
Thank you @marius311! I use the first approach (with @eval). Sorry for my ignorance, but how should I proceed with the second approach? I mean, I execute |
Sorry to sound like a broken record and I know we discussed in #10 but there's still an infinite loop path in bisect. I confirm because I run into it sporadically, and editing this line to read
if c.dϕ >= 0 || numfg>10
to break out if it tries more than 10 bisect steps fixes it for me.No doubt I have some numerically noisy gradients causing this, and I'm happy if the package sends me a warning or even errors when bisect fails due to that, but just infinite looping really kills my analysis (eg I run 100 sims and step away from my computer for a while, only to come back and find sim 3 got stuck in an infinite loop and it never went further).
The text was updated successfully, but these errors were encountered: