-
Notifications
You must be signed in to change notification settings - Fork 2
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
Why return the *function* value when maxIter fails to converge to tolerance? #2
Comments
Having taken a quick look at the code, I suspect the intention was to
return an "argument", and it's just a bug.
…On Mon, Sep 17, 2018 at 10:02 PM Ahmed Fasih ***@***.***> wrote:
I was optimizing a function of Dates, and just using this fine library
with lowerBound and upperBound without specifying the tolerance/maxIter,
and was surprised to see *function* outputs rather than argument outputs,
till I read in the docs that,
If tolerance is not met, returns best answer.
(This is what triggered my #1
<#1>… 😅)
This is such a surprising behavior for when the tolerance is not met, I
almost think that it'd be better to throw an error in this situation rather
than return the *function's value*?
Just a suggestion. Now I've made my tolerance 1e3 (since my function
operates on milliseconds since Unix epoch) and am getting totally sane
results, hooray!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADHOwQ_4JO2Qj6FB7mpuRsngkm4vNa8Vks5ub__VgaJpZM4WsnPE>
.
|
You're right! That makes precisely no sense at all. Gosh, it's painful to read old code. What do you think about an optional status = {value: minimizedValue, iterations: ##, converged: true|false}` That way you can get lazy and just use it inline ( Edit: Ah, and if you return |
Fixed by #4! |
I was minimizing a function of
Date
s using this fine library, with justlowerBound
andupperBound
and without specifyingtolerance
/maxIter
, and was surprised to see function values instead of argument values as output, till I read in the docs that,(This is what triggered my #1… 😅)
This is such a surprising behavior for when the tolerance is not met, I almost think that it'd be better to throw an error in this situation rather than return the function's value?
Just a suggestion. Now I've made my tolerance 1e3 (since my function operates on milliseconds since Unix epoch) and am getting perfect results, hooray!
The text was updated successfully, but these errors were encountered: