-
Notifications
You must be signed in to change notification settings - Fork 3
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
Large number of iterations #15
Comments
It seems that this function is not well suited for SPGBox for two reasons:
I am afraid that there is nothing that can be done. SPGBox was not designed to minimize such a function. |
Thank you for explaining what is going on. I've made a pull request to add these assumptions to the documentation. |
This is a more extreme example, where the curvature is negative on both sides. I have added a parameter to control the step size when the curvature is negative ( Example: julia> f(x) = sqrt(abs(x[1]))
f (generic function with 1 method)
julia> g!(g,x) = if x[1] <= 0 g[1] = -inv(2*sqrt(abs(x[1]))) else g[1] = inv(2*sqrt(x[1])) end
g! (generic function with 1 method)
julia> spgbox(f, g!, [0.3], lower=[-1.0], upper=[1.0], m=1, step_nc=1e-1)
SPGBOX RESULT:
Maximum number of function evaluations (nfevalmax) reached.
Final objective function value = 4.298219575868233e-17
Sample of best point = Vector{Float64}[ 1.8474691522376893e-33]
Projected gradient norm = 1.0
Number of iterations = 59
Number of function evaluations = 1001 |
I am trying to use SPGBox.jl in a simple problem, but the result is not very good and it takes too many iterations. To reproduce, first install the package
SinusoidalRegressions.jl
. Then,Here,
fun(f)
is "U" shaped with a single minimum atf = 0.43
:Since I know that the minimum is in the range
1 < f < 0
, I try to find the minimum as follows:It can be seen that the algorithm fails to converge, the minimum estimate (0.4257) is not very good, and that the number of function evaluations is too high. Other optimization algorithms I've tried can find the minimum in 5-6 iterations.
The text was updated successfully, but these errors were encountered: