-
Notifications
You must be signed in to change notification settings - Fork 5
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
Explore optimization algorithms #14
Comments
Switching from NLopt to PRIMA could look like this for a typical BOBYQA use case NLopt opt = Opt(:LN_BOBYQA, num_params)
min_objective!(opt, (x,y) -> (objective ∘ unflatten)(x))
lower_bounds!(opt, [-5.0 for i in 1:num_params])
upper_bounds!(opt, [5.0 for i in 1:num_params])
xtol_rel!(opt, 1e-12)
score,mini,did_it_work = NLopt.optimize(opt, flat_initial_params)
final_params = unflatten(mini)
optimized_model = build_model_vec(final_params)
LL = log_likelihood!(tree,optimized_model)
println(did_it_work)
println("Opt LL:",LL) PRIMA lower_bounds = [-5.0 for i in 1:num_params]
upper_bounds = [5.0 for i in 1:num_params]
tr_radius = 1e-12 #trust-region radius
mini, info = bobyqa(objective ∘ unflatten, flat_initial_params, xl=lower_bounds, xu=upper_bounds, rhoend=tr_radius)
final_params = unflatten(mini)
optimized_model = build_model_vec(final_params)
LL = log_likelihood!(tree,optimized_model)
println("SUCCESS: $(issuccess(info))")
println("Opt LL:",LL) |
Did we ever figure out if this switch made things faster in most cases? |
No, I never took this further than a working example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
... for rates, and for discrete distributions (ie. with a
sum to 1
constraint). Start here: https://github.com/libprima/PRIMA.jlThe text was updated successfully, but these errors were encountered: