Initial start point #63
-
Hi, can we specify the initial parameters (i.e., specify the first x and y) when running the optimization, e.g., with Hill Climbing instead of starting from random points? |
Beta Was this translation helpful? Give feedback.
Answered by
SimonBlanke
Feb 24, 2025
Replies: 1 comment
-
Hello @glitchyordis, yes this is possible via the "warm_start" key in the import numpy as np
from gradient_free_optimizers import HillClimbingOptimizer
def parabola_function(para):
loss = para["x"] * para["x"]
return -loss
search_space = {"x": np.arange(-10, 10, 0.1)}
init_para = {
"x": 5,
}
initialize = {"warm_start": [init_para]}
opt = HillClimbingOptimizer(search_space, initialize=initialize)
opt.search(parabola_function, n_iter=50) Here is the API ref for this feature: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
glitchyordis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @glitchyordis,
yes this is possible via the "warm_start" key in the
initialize
-dictionary. Here is an example:Here is the API ref for this feature:
https://simonblanke.github.io/gradient-free-optimizers-documentation/1.5/base_optimizer/#initialize
At the moment the docs miss an example for this. I will add…