-
Notifications
You must be signed in to change notification settings - Fork 224
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
meaning of f_calls_limit is misleading #1053
Comments
Something I just remarked:
So in total we have This opens up another possibility: Edit: |
This is a very reasonable thing to want, but it's not clear it's technically feasible. Suppose you defined It is true that in the special case when Optim has created the gradient itself that Optim could know how many calls are being made, but is it better for the interpretation of More generally, I think the right way to optimize this stuff is for the caller to do the optimization rather than for Optim to be more clever -- this is why the Optim interface takes in things like |
I think so, why not? If you provide the gradient, it is expected that the number of calls to the underlying function would be a lot smaller. It's another way to sense the usefulness of providing a gradient function. |
I think this has been discussed quite a few times. You can argue either way. But you're right, it's not necessarily counting the number of times |
I think perhaps a better description of what that is (objective calls) and what is not (does not count objectives in gradient), would be sufficient: https://julianlsolvers.github.io/Optim.jl/stable/#user/config/#general-options. |
I have added a better description in this #1054. |
I think they are two separate issues. I'm on board with merging your change to the description, but I'm not sure about showing the full minimizer. |
See the following code and the output. We count the number of calls made to the
rosenbrock
function. As you can see in the output, theoptimize
method reports only 53 calls of the function. However there arecount_calls=[256]
, way above thef_calls_limit=100
, so clearly not all function calls are reported byoptimize
.Perhaps
optimize
only counts the direct calls to the function and ignore the calls required to compute the gradient and the hessian by finite differences. In my opinion,f_calls_limit
shall refer to all possible calls of the original function. Otherwise we just get a hidden behavior.The text was updated successfully, but these errors were encountered: