Resume a gp_minimize process from a checkpoint in Skopt

841 Views Asked by At

I want to resume a gp process but I am getting strange messages. I start my gp process providing only x0 and y0=None. My initial points are 30 and n_evals = 50. I stop it at evaluation no 20. Then I load the result and following the example from the documentation I provide x0 and y0 (both are list of lists) and run the same process. (I have restarted the kernel obv.) However, even after evaluation no. 12 the message is: Iteration No: 13 started. Evaluating function at random point. where it should be searching for the next optimal point.

Am I doing something wrong?

x0 = res.x_iters
y0 = res.func_vals


gp_res = gp_minimize(func=fitness,                             
                            dimensions=space,
                            n_calls=50,
                            n_jobs=-1,
                            n_initial_points=30,
                            initial_point_generator=lhs,
                            verbose=True,
                            acq_func='gp_hedge',
                            acq_optimizer='lbfgs',
                            n_restarts_optimizer=15,
                            y0=y0,
                            random_state=seed,
                            callback=[checkpoint_callback,delta_callback],
                            n_points=10000,   
                            kappa=1.96,      
                            xi=0.01,           
                            noise='gaussian',
                            model_queue_size=None,
                            x0=x0)
1

There are 1 best solutions below

0
je-dbl On

Had a similar issue. While looking for an answer, I stumpled upon this issue on the GitHub page : https://github.com/scikit-optimize/scikit-optimize/issues/949

What is suggested is to "set the value of n_initial_points to the negative of the number of values in the res0.x_iters", which seems to work for me.

In your case, I assume it would look like this :

x0 = res.x_iters
y0 = res.func_vals


gp_res = gp_minimize(func=fitness,                             
                            dimensions=space,
                            n_calls=50,
                            n_jobs=-1,
                          ->n_initial_points=-len(x0),
                            initial_point_generator=lhs,
                            verbose=True,
                            acq_func='gp_hedge',
                            acq_optimizer='lbfgs',
                            n_restarts_optimizer=15,
                            y0=y0,
                            random_state=seed,
                            callback=[checkpoint_callback,delta_callback],
                            n_points=10000,   
                            kappa=1.96,      
                            xi=0.01,           
                            noise='gaussian',
                            model_queue_size=None,
                            x0=x0)