Bayesian Optimization


In [1]:
import openturns as ot
import numpy as np
import matplotlib.pyplot as plt
from skgarden import RandomForestQuantileRegressor
from depimpact.plots import set_style_paper
from skopt import forest_minimize
from skopt.acquisition import gaussian_ei, gaussian_lcb, gaussian_pi

%matplotlib inline
%load_ext autoreload
%autoreload 2
set_style_paper()

The stochastic function


In [2]:
from scipy.special import erfinv
def func(X, noise_lvl=0.2, nu=1., return_quantile=False, type_noise='uniform', alpha=0.05):
    """
    """
    X = np.asarray(X)
    n_sample = X.shape[0]
    if type_noise == 'uniform':
        noise = np.random.uniform(-noise_lvl, noise_lvl, n_sample)
    elif type_noise == 'normal':
        noise = np.random.normal(0., noise_lvl, n_sample)
    else:
        raise ValueError('Wrong type_noise')
        
    y = X*np.cos(2*np.pi*X) + (X-nu)**2*noise
    if return_quantile:
        if type_noise == 'uniform':
            q = 2*noise_lvl*alpha - noise_lvl
        elif type_noise == 'normal':
            q = noise_lvl*np.sqrt(2)*erfinv * (2*alpha - 1)
            
        quantile = X*np.cos(2*np.pi*X) + (X-nu)**2*q 
        if n_sample == 1:
            return y.item(), quantile.item()
        else:
            return y, quantile
    else:
        if n_sample == 1:
            return y.item()
        else:
            return y

Illustration


In [3]:
xmin, xmax = -np.pi/2, np.pi/2.

def plot_func(func, xmin, xmax, n_plot=100000, alpha=0.05, ax=None):
    x_plot = np.linspace(xmin, xmax, n_plot)
    y_true = func(x_plot, noise_lvl=0.)
    y_noised, quant = func(x_plot, return_quantile=True, alpha=alpha)
    id_min_true = y_true.argmin()
    id_min_noised = quant.argmin()

    if ax is None:
        fig, ax = plt.subplots(figsize=(7, 4))
    ax.plot(x_plot, y_true, 'g-', label='Mean')
    ax.plot(x_plot, quant, 'k-', label='Quantile at $\\alpha=%d$ %%' % (alpha*100))
    #ax.plot(x_plot[id_min_true], y_true[id_min_true], 'go', label='Excepted min')
    #ax.plot(x_plot[id_min_noised], quant[id_min_noised], 'ro', label='Quantile min')
    ax.set_xlim(xmin, xmax)
    ax.set_xlabel('$x$')    
    ax.set_ylabel('$y$')
    return ax

fig, ax = plt.subplots(figsize=(7, 4))
plot_func(func, xmin, xmax, ax=ax)
ax.legend(loc=0)
fig.tight_layout()


Optimization


In [4]:
class ModifiedRandomForestQuantileRegressor(RandomForestQuantileRegressor):
    def predict(self, X, return_std=False):
        """
        """
        X = np.asarray(X)
        alpha = 0.05
        if return_std:
            n_sample = X.shape[0]
            n_estimators = self.n_estimators
            pred = np.zeros((n_estimators, n_sample))
            for i, tree in enumerate(self.estimators_):
                pred[i] = tree.predict(X, quantile=alpha*100)

            mean = pred.mean(axis=0)
            std = pred.std(axis=0)
            return mean, std
        else:
            mean = RandomForestQuantileRegressor.predict(self, X, quantile=alpha*100)
            return mean

In [5]:
n_random_starts = 50
n_iter = 100
n_estimators = 200
min_samples_split = max(2, int(n_random_starts/10))
rfq = ModifiedRandomForestQuantileRegressor(n_estimators, min_samples_split=min_samples_split, n_jobs=7)
n_calls = n_random_start + n_iter
space = [(xmin, xmax)]
acq_func = 'EI'

opt_res = forest_minimize(func, space, acq_func=acq_func, base_estimator=rfq,
                      n_calls=n_calls, n_random_starts=n_random_starts, n_jobs=7, verbose=True)


Iteration No: 1 started. Evaluating function at random point.
Iteration No: 1 ended. Evaluation done at random point.
Time taken: 0.0011
Function value obtained: -1.4609
Current minimum: -1.4609
Iteration No: 2 started. Evaluating function at random point.
Iteration No: 2 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.0731
Current minimum: -1.4609
Iteration No: 3 started. Evaluating function at random point.
Iteration No: 3 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 1.0099
Current minimum: -1.4609
Iteration No: 4 started. Evaluating function at random point.
Iteration No: 4 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.7427
Current minimum: -1.4609
Iteration No: 5 started. Evaluating function at random point.
Iteration No: 5 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -1.4953
Current minimum: -1.4953
Iteration No: 6 started. Evaluating function at random point.
Iteration No: 6 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.4978
Current minimum: -1.4953
Iteration No: 7 started. Evaluating function at random point.
Iteration No: 7 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.2902
Current minimum: -1.4953
Iteration No: 8 started. Evaluating function at random point.
Iteration No: 8 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.4008
Current minimum: -1.4953
Iteration No: 9 started. Evaluating function at random point.
Iteration No: 9 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.5245
Current minimum: -1.4953
Iteration No: 10 started. Evaluating function at random point.
Iteration No: 10 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.5930
Current minimum: -1.4953
Iteration No: 11 started. Evaluating function at random point.
Iteration No: 11 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.4384
Current minimum: -1.4953
Iteration No: 12 started. Evaluating function at random point.
Iteration No: 12 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.0975
Current minimum: -1.4953
Iteration No: 13 started. Evaluating function at random point.
Iteration No: 13 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.8470
Current minimum: -1.4953
Iteration No: 14 started. Evaluating function at random point.
Iteration No: 14 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.5346
Current minimum: -1.4953
Iteration No: 15 started. Evaluating function at random point.
Iteration No: 15 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.3934
Current minimum: -1.4953
Iteration No: 16 started. Evaluating function at random point.
Iteration No: 16 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.0165
Current minimum: -1.4953
Iteration No: 17 started. Evaluating function at random point.
Iteration No: 17 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.4028
Current minimum: -1.4953
Iteration No: 18 started. Evaluating function at random point.
Iteration No: 18 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.7922
Current minimum: -1.4953
Iteration No: 19 started. Evaluating function at random point.
Iteration No: 19 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.1150
Current minimum: -1.4953
Iteration No: 20 started. Evaluating function at random point.
Iteration No: 20 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.3933
Current minimum: -1.4953
Iteration No: 21 started. Evaluating function at random point.
Iteration No: 21 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.9207
Current minimum: -1.4953
Iteration No: 22 started. Evaluating function at random point.
Iteration No: 22 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.4901
Current minimum: -1.4953
Iteration No: 23 started. Evaluating function at random point.
Iteration No: 23 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.9877
Current minimum: -1.4953
Iteration No: 24 started. Evaluating function at random point.
Iteration No: 24 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -1.2339
Current minimum: -1.4953
Iteration No: 25 started. Evaluating function at random point.
Iteration No: 25 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.1592
Current minimum: -1.4953
Iteration No: 26 started. Evaluating function at random point.
Iteration No: 26 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.8584
Current minimum: -1.4953
Iteration No: 27 started. Evaluating function at random point.
Iteration No: 27 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.2150
Current minimum: -1.4953
Iteration No: 28 started. Evaluating function at random point.
Iteration No: 28 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.0834
Current minimum: -1.4953
Iteration No: 29 started. Evaluating function at random point.
Iteration No: 29 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -1.2368
Current minimum: -1.4953
Iteration No: 30 started. Evaluating function at random point.
Iteration No: 30 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.4761
Current minimum: -1.4953
Iteration No: 31 started. Evaluating function at random point.
Iteration No: 31 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.9264
Current minimum: -1.4953
Iteration No: 32 started. Evaluating function at random point.
Iteration No: 32 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.0678
Current minimum: -1.4953
Iteration No: 33 started. Evaluating function at random point.
Iteration No: 33 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.0263
Current minimum: -1.4953
Iteration No: 34 started. Evaluating function at random point.
Iteration No: 34 ended. Evaluation done at random point.
Time taken: 0.0003
Function value obtained: -0.4902
Current minimum: -1.4953
Iteration No: 35 started. Evaluating function at random point.
Iteration No: 35 ended. Evaluation done at random point.
Time taken: 0.0003
Function value obtained: -0.3428
Current minimum: -1.4953
Iteration No: 36 started. Evaluating function at random point.
Iteration No: 36 ended. Evaluation done at random point.
Time taken: 0.0003
Function value obtained: 0.1639
Current minimum: -1.4953
Iteration No: 37 started. Evaluating function at random point.
Iteration No: 37 ended. Evaluation done at random point.
Time taken: 0.0003
Function value obtained: 1.0108
Current minimum: -1.4953
Iteration No: 38 started. Evaluating function at random point.
Iteration No: 38 ended. Evaluation done at random point.
Time taken: 0.0003
Function value obtained: 0.1171
Current minimum: -1.4953
Iteration No: 39 started. Evaluating function at random point.
Iteration No: 39 ended. Evaluation done at random point.
Time taken: 0.0003
Function value obtained: 0.4268
Current minimum: -1.4953
Iteration No: 40 started. Evaluating function at random point.
Iteration No: 40 ended. Evaluation done at random point.
Time taken: 0.0003
Function value obtained: 0.2904
Current minimum: -1.4953
Iteration No: 41 started. Evaluating function at random point.
Iteration No: 41 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.2535
Current minimum: -1.4953
Iteration No: 42 started. Evaluating function at random point.
Iteration No: 42 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.4043
Current minimum: -1.4953
Iteration No: 43 started. Evaluating function at random point.
Iteration No: 43 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 1.9195
Current minimum: -1.4953
Iteration No: 44 started. Evaluating function at random point.
Iteration No: 44 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -1.2208
Current minimum: -1.4953
Iteration No: 45 started. Evaluating function at random point.
Iteration No: 45 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.5002
Current minimum: -1.4953
Iteration No: 46 started. Evaluating function at random point.
Iteration No: 46 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.3010
Current minimum: -1.4953
Iteration No: 47 started. Evaluating function at random point.
Iteration No: 47 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.3379
Current minimum: -1.4953
Iteration No: 48 started. Evaluating function at random point.
Iteration No: 48 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: -0.0303
Current minimum: -1.4953
Iteration No: 49 started. Evaluating function at random point.
Iteration No: 49 ended. Evaluation done at random point.
Time taken: 0.0004
Function value obtained: 0.8372
Current minimum: -1.4953
Iteration No: 50 started. Evaluating function at random point.
Iteration No: 50 ended. Evaluation done at random point.
Time taken: 1.1746
Function value obtained: 0.6548
Current minimum: -1.4953
Iteration No: 51 started. Searching for the next optimal point.
Iteration No: 51 ended. Search finished for the next optimal point.
Time taken: 1.3088
Function value obtained: -0.9089
Current minimum: -1.4953
Iteration No: 52 started. Searching for the next optimal point.
Iteration No: 52 ended. Search finished for the next optimal point.
Time taken: 1.1791
Function value obtained: -0.5852
Current minimum: -1.4953
Iteration No: 53 started. Searching for the next optimal point.
Iteration No: 53 ended. Search finished for the next optimal point.
Time taken: 1.2678
Function value obtained: -0.8282
Current minimum: -1.4953
Iteration No: 54 started. Searching for the next optimal point.
Iteration No: 54 ended. Search finished for the next optimal point.
Time taken: 1.2837
Function value obtained: 0.0303
Current minimum: -1.4953
Iteration No: 55 started. Searching for the next optimal point.
Iteration No: 55 ended. Search finished for the next optimal point.
Time taken: 1.1831
Function value obtained: -0.6646
Current minimum: -1.4953
Iteration No: 56 started. Searching for the next optimal point.
Iteration No: 56 ended. Search finished for the next optimal point.
Time taken: 1.2067
Function value obtained: -0.4879
Current minimum: -1.4953
Iteration No: 57 started. Searching for the next optimal point.
Iteration No: 57 ended. Search finished for the next optimal point.
Time taken: 1.3093
Function value obtained: -1.0460
Current minimum: -1.4953
Iteration No: 58 started. Searching for the next optimal point.
Iteration No: 58 ended. Search finished for the next optimal point.
Time taken: 1.2352
Function value obtained: -1.4279
Current minimum: -1.4953
Iteration No: 59 started. Searching for the next optimal point.
Iteration No: 59 ended. Search finished for the next optimal point.
Time taken: 1.2672
Function value obtained: -1.0871
Current minimum: -1.4953
Iteration No: 60 started. Searching for the next optimal point.
Iteration No: 60 ended. Search finished for the next optimal point.
Time taken: 1.3010
Function value obtained: 0.2273
Current minimum: -1.4953
Iteration No: 61 started. Searching for the next optimal point.
Iteration No: 61 ended. Search finished for the next optimal point.
Time taken: 1.3254
Function value obtained: -1.1057
Current minimum: -1.4953
Iteration No: 62 started. Searching for the next optimal point.
Iteration No: 62 ended. Search finished for the next optimal point.
Time taken: 1.3371
Function value obtained: -0.1023
Current minimum: -1.4953
Iteration No: 63 started. Searching for the next optimal point.
Iteration No: 63 ended. Search finished for the next optimal point.
Time taken: 1.3595
Function value obtained: -0.9552
Current minimum: -1.4953
Iteration No: 64 started. Searching for the next optimal point.
Iteration No: 64 ended. Search finished for the next optimal point.
Time taken: 1.4625
Function value obtained: -0.1852
Current minimum: -1.4953
Iteration No: 65 started. Searching for the next optimal point.
Iteration No: 65 ended. Search finished for the next optimal point.
Time taken: 1.3719
Function value obtained: -0.6245
Current minimum: -1.4953
Iteration No: 66 started. Searching for the next optimal point.
Iteration No: 66 ended. Search finished for the next optimal point.
Time taken: 1.2628
Function value obtained: -1.2821
Current minimum: -1.4953
Iteration No: 67 started. Searching for the next optimal point.
Iteration No: 67 ended. Search finished for the next optimal point.
Time taken: 1.2808
Function value obtained: -0.5407
Current minimum: -1.4953
Iteration No: 68 started. Searching for the next optimal point.
Iteration No: 68 ended. Search finished for the next optimal point.
Time taken: 1.2821
Function value obtained: -0.6192
Current minimum: -1.4953
Iteration No: 69 started. Searching for the next optimal point.
Iteration No: 69 ended. Search finished for the next optimal point.
Time taken: 1.4636
Function value obtained: -1.5997
Current minimum: -1.5997
Iteration No: 70 started. Searching for the next optimal point.
Iteration No: 70 ended. Search finished for the next optimal point.
Time taken: 1.3913
Function value obtained: -1.6356
Current minimum: -1.6356
Iteration No: 71 started. Searching for the next optimal point.
Iteration No: 71 ended. Search finished for the next optimal point.
Time taken: 1.3944
Function value obtained: -0.5352
Current minimum: -1.6356
Iteration No: 72 started. Searching for the next optimal point.
Iteration No: 72 ended. Search finished for the next optimal point.
Time taken: 1.2850
Function value obtained: -1.6533
Current minimum: -1.6533
Iteration No: 73 started. Searching for the next optimal point.
Iteration No: 73 ended. Search finished for the next optimal point.
Time taken: 1.4027
Function value obtained: -0.9775
Current minimum: -1.6533
Iteration No: 74 started. Searching for the next optimal point.
Iteration No: 74 ended. Search finished for the next optimal point.
Time taken: 1.3270
Function value obtained: -1.0583
Current minimum: -1.6533
Iteration No: 75 started. Searching for the next optimal point.
Iteration No: 75 ended. Search finished for the next optimal point.
Time taken: 1.3353
Function value obtained: -0.7195
Current minimum: -1.6533
Iteration No: 76 started. Searching for the next optimal point.
Iteration No: 76 ended. Search finished for the next optimal point.
Time taken: 1.4211
Function value obtained: -1.1728
Current minimum: -1.6533
Iteration No: 77 started. Searching for the next optimal point.
Iteration No: 77 ended. Search finished for the next optimal point.
Time taken: 1.4878
Function value obtained: -1.3208
Current minimum: -1.6533
Iteration No: 78 started. Searching for the next optimal point.
Iteration No: 78 ended. Search finished for the next optimal point.
Time taken: 1.4465
Function value obtained: -0.3383
Current minimum: -1.6533
Iteration No: 79 started. Searching for the next optimal point.
Iteration No: 79 ended. Search finished for the next optimal point.
Time taken: 1.4306
Function value obtained: -1.0332
Current minimum: -1.6533
Iteration No: 80 started. Searching for the next optimal point.
Iteration No: 80 ended. Search finished for the next optimal point.
Time taken: 1.5530
Function value obtained: -0.8943
Current minimum: -1.6533
Iteration No: 81 started. Searching for the next optimal point.
Iteration No: 81 ended. Search finished for the next optimal point.
Time taken: 1.5657
Function value obtained: -0.9309
Current minimum: -1.6533
Iteration No: 82 started. Searching for the next optimal point.
Iteration No: 82 ended. Search finished for the next optimal point.
Time taken: 1.5718
Function value obtained: -0.2104
Current minimum: -1.6533
Iteration No: 83 started. Searching for the next optimal point.
Iteration No: 83 ended. Search finished for the next optimal point.
Time taken: 1.3783
Function value obtained: -0.5705
Current minimum: -1.6533
Iteration No: 84 started. Searching for the next optimal point.
Iteration No: 84 ended. Search finished for the next optimal point.
Time taken: 1.3836
Function value obtained: -0.5858
Current minimum: -1.6533
Iteration No: 85 started. Searching for the next optimal point.
Iteration No: 85 ended. Search finished for the next optimal point.
Time taken: 1.3832
Function value obtained: -1.0241
Current minimum: -1.6533
Iteration No: 86 started. Searching for the next optimal point.
Iteration No: 86 ended. Search finished for the next optimal point.
Time taken: 1.4593
Function value obtained: -1.3204
Current minimum: -1.6533
Iteration No: 87 started. Searching for the next optimal point.
Iteration No: 87 ended. Search finished for the next optimal point.
Time taken: 1.4009
Function value obtained: -1.2663
Current minimum: -1.6533
Iteration No: 88 started. Searching for the next optimal point.
Iteration No: 88 ended. Search finished for the next optimal point.
Time taken: 1.5073
Function value obtained: -0.4796
Current minimum: -1.6533
Iteration No: 89 started. Searching for the next optimal point.
Iteration No: 89 ended. Search finished for the next optimal point.
Time taken: 1.4333
Function value obtained: -0.2405
Current minimum: -1.6533
Iteration No: 90 started. Searching for the next optimal point.
Iteration No: 90 ended. Search finished for the next optimal point.
Time taken: 1.5209
Function value obtained: -1.1396
Current minimum: -1.6533
Iteration No: 91 started. Searching for the next optimal point.
Iteration No: 91 ended. Search finished for the next optimal point.
Time taken: 1.4143
Function value obtained: -1.1935
Current minimum: -1.6533
Iteration No: 92 started. Searching for the next optimal point.
Iteration No: 92 ended. Search finished for the next optimal point.
Time taken: 1.4269
Function value obtained: -1.2097
Current minimum: -1.6533
Iteration No: 93 started. Searching for the next optimal point.
Iteration No: 93 ended. Search finished for the next optimal point.
Time taken: 1.5254
Function value obtained: -1.1508
Current minimum: -1.6533
Iteration No: 94 started. Searching for the next optimal point.
Iteration No: 94 ended. Search finished for the next optimal point.
Time taken: 1.5658
Function value obtained: -0.7128
Current minimum: -1.6533
Iteration No: 95 started. Searching for the next optimal point.
Iteration No: 95 ended. Search finished for the next optimal point.
Time taken: 1.6393
Function value obtained: -0.3034
Current minimum: -1.6533
Iteration No: 96 started. Searching for the next optimal point.
Iteration No: 96 ended. Search finished for the next optimal point.
Time taken: 1.5807
Function value obtained: -0.2045
Current minimum: -1.6533
Iteration No: 97 started. Searching for the next optimal point.
Iteration No: 97 ended. Search finished for the next optimal point.
Time taken: 1.6780
Function value obtained: -1.0611
Current minimum: -1.6533
Iteration No: 98 started. Searching for the next optimal point.
Iteration No: 98 ended. Search finished for the next optimal point.
Time taken: 1.5847
Function value obtained: -0.1525
Current minimum: -1.6533
Iteration No: 99 started. Searching for the next optimal point.
Iteration No: 99 ended. Search finished for the next optimal point.
Time taken: 1.5951
Function value obtained: -1.0377
Current minimum: -1.6533
Iteration No: 100 started. Searching for the next optimal point.
Iteration No: 100 ended. Search finished for the next optimal point.
Time taken: 1.6946
Function value obtained: -0.6358
Current minimum: -1.6533
Iteration No: 101 started. Searching for the next optimal point.
Iteration No: 101 ended. Search finished for the next optimal point.
Time taken: 1.5894
Function value obtained: -1.0265
Current minimum: -1.6533
Iteration No: 102 started. Searching for the next optimal point.
Iteration No: 102 ended. Search finished for the next optimal point.
Time taken: 1.6844
Function value obtained: -0.4785
Current minimum: -1.6533
Iteration No: 103 started. Searching for the next optimal point.
Iteration No: 103 ended. Search finished for the next optimal point.
Time taken: 1.6888
Function value obtained: -0.3213
Current minimum: -1.6533
Iteration No: 104 started. Searching for the next optimal point.
Iteration No: 104 ended. Search finished for the next optimal point.
Time taken: 1.7846
Function value obtained: -0.2814
Current minimum: -1.6533
Iteration No: 105 started. Searching for the next optimal point.
Iteration No: 105 ended. Search finished for the next optimal point.
Time taken: 1.6198
Function value obtained: -1.1431
Current minimum: -1.6533
Iteration No: 106 started. Searching for the next optimal point.
Iteration No: 106 ended. Search finished for the next optimal point.
Time taken: 1.7322
Function value obtained: -1.2408
Current minimum: -1.6533
Iteration No: 107 started. Searching for the next optimal point.
Iteration No: 107 ended. Search finished for the next optimal point.
Time taken: 1.7285
Function value obtained: -0.8831
Current minimum: -1.6533
Iteration No: 108 started. Searching for the next optimal point.
Iteration No: 108 ended. Search finished for the next optimal point.
Time taken: 1.5097
Function value obtained: -0.8263
Current minimum: -1.6533
Iteration No: 109 started. Searching for the next optimal point.
Iteration No: 109 ended. Search finished for the next optimal point.
Time taken: 1.7306
Function value obtained: -1.0830
Current minimum: -1.6533
Iteration No: 110 started. Searching for the next optimal point.
Iteration No: 110 ended. Search finished for the next optimal point.
Time taken: 1.7384
Function value obtained: -1.5610
Current minimum: -1.6533
Iteration No: 111 started. Searching for the next optimal point.
Iteration No: 111 ended. Search finished for the next optimal point.
Time taken: 1.5136
Function value obtained: -0.7076
Current minimum: -1.6533
Iteration No: 112 started. Searching for the next optimal point.
Iteration No: 112 ended. Search finished for the next optimal point.
Time taken: 1.7433
Function value obtained: -0.5596
Current minimum: -1.6533
Iteration No: 113 started. Searching for the next optimal point.
Iteration No: 113 ended. Search finished for the next optimal point.
Time taken: 1.8242
Function value obtained: -0.9910
Current minimum: -1.6533
Iteration No: 114 started. Searching for the next optimal point.
Iteration No: 114 ended. Search finished for the next optimal point.
Time taken: 1.7532
Function value obtained: -0.6198
Current minimum: -1.6533
Iteration No: 115 started. Searching for the next optimal point.
Iteration No: 115 ended. Search finished for the next optimal point.
Time taken: 1.7494
Function value obtained: -0.7737
Current minimum: -1.6533
Iteration No: 116 started. Searching for the next optimal point.
Iteration No: 116 ended. Search finished for the next optimal point.
Time taken: 1.7420
Function value obtained: -1.0556
Current minimum: -1.6533
Iteration No: 117 started. Searching for the next optimal point.
Iteration No: 117 ended. Search finished for the next optimal point.
Time taken: 1.5837
Function value obtained: -1.0809
Current minimum: -1.6533
Iteration No: 118 started. Searching for the next optimal point.
Iteration No: 118 ended. Search finished for the next optimal point.
Time taken: 1.6445
Function value obtained: -0.7251
Current minimum: -1.6533
Iteration No: 119 started. Searching for the next optimal point.
Iteration No: 119 ended. Search finished for the next optimal point.
Time taken: 1.6699
Function value obtained: -0.8614
Current minimum: -1.6533
Iteration No: 120 started. Searching for the next optimal point.
Iteration No: 120 ended. Search finished for the next optimal point.
Time taken: 1.6301
Function value obtained: -1.2317
Current minimum: -1.6533
Iteration No: 121 started. Searching for the next optimal point.
Iteration No: 121 ended. Search finished for the next optimal point.
Time taken: 1.7135
Function value obtained: -1.5386
Current minimum: -1.6533
Iteration No: 122 started. Searching for the next optimal point.
Iteration No: 122 ended. Search finished for the next optimal point.
Time taken: 1.7221
Function value obtained: -1.1135
Current minimum: -1.6533
Iteration No: 123 started. Searching for the next optimal point.
Iteration No: 123 ended. Search finished for the next optimal point.
Time taken: 1.6772
Function value obtained: -1.5426
Current minimum: -1.6533
Iteration No: 124 started. Searching for the next optimal point.
Iteration No: 124 ended. Search finished for the next optimal point.
Time taken: 1.6829
Function value obtained: -0.2487
Current minimum: -1.6533
Iteration No: 125 started. Searching for the next optimal point.
Iteration No: 125 ended. Search finished for the next optimal point.
Time taken: 1.5931
Function value obtained: -0.3137
Current minimum: -1.6533
Iteration No: 126 started. Searching for the next optimal point.
Iteration No: 126 ended. Search finished for the next optimal point.
Time taken: 1.7075
Function value obtained: -0.6687
Current minimum: -1.6533
Iteration No: 127 started. Searching for the next optimal point.
Iteration No: 127 ended. Search finished for the next optimal point.
Time taken: 1.7174
Function value obtained: -1.5663
Current minimum: -1.6533
Iteration No: 128 started. Searching for the next optimal point.
Iteration No: 128 ended. Search finished for the next optimal point.
Time taken: 1.7077
Function value obtained: -0.3473
Current minimum: -1.6533
Iteration No: 129 started. Searching for the next optimal point.
Iteration No: 129 ended. Search finished for the next optimal point.
Time taken: 1.5744
Function value obtained: -0.6327
Current minimum: -1.6533
Iteration No: 130 started. Searching for the next optimal point.
Iteration No: 130 ended. Search finished for the next optimal point.
Time taken: 1.7819
Function value obtained: -0.1575
Current minimum: -1.6533
Iteration No: 131 started. Searching for the next optimal point.
Iteration No: 131 ended. Search finished for the next optimal point.
Time taken: 1.7126
Function value obtained: -1.2646
Current minimum: -1.6533
Iteration No: 132 started. Searching for the next optimal point.
Iteration No: 132 ended. Search finished for the next optimal point.
Time taken: 1.7569
Function value obtained: -1.6477
Current minimum: -1.6533
Iteration No: 133 started. Searching for the next optimal point.
Iteration No: 133 ended. Search finished for the next optimal point.
Time taken: 1.6262
Function value obtained: -0.4861
Current minimum: -1.6533
Iteration No: 134 started. Searching for the next optimal point.
Iteration No: 134 ended. Search finished for the next optimal point.
Time taken: 1.6255
Function value obtained: -1.6464
Current minimum: -1.6533
Iteration No: 135 started. Searching for the next optimal point.
Iteration No: 135 ended. Search finished for the next optimal point.
Time taken: 1.7181
Function value obtained: -1.6231
Current minimum: -1.6533
Iteration No: 136 started. Searching for the next optimal point.
Iteration No: 136 ended. Search finished for the next optimal point.
Time taken: 1.6122
Function value obtained: -1.6401
Current minimum: -1.6533
Iteration No: 137 started. Searching for the next optimal point.
Iteration No: 137 ended. Search finished for the next optimal point.
Time taken: 1.7521
Function value obtained: -0.9583
Current minimum: -1.6533
Iteration No: 138 started. Searching for the next optimal point.
Iteration No: 138 ended. Search finished for the next optimal point.
Time taken: 1.6883
Function value obtained: -0.7005
Current minimum: -1.6533
Iteration No: 139 started. Searching for the next optimal point.
Iteration No: 139 ended. Search finished for the next optimal point.
Time taken: 1.8776
Function value obtained: -1.2380
Current minimum: -1.6533
Iteration No: 140 started. Searching for the next optimal point.
Iteration No: 140 ended. Search finished for the next optimal point.
Time taken: 1.6718
Function value obtained: -0.3181
Current minimum: -1.6533
Iteration No: 141 started. Searching for the next optimal point.
Iteration No: 141 ended. Search finished for the next optimal point.
Time taken: 1.7698
Function value obtained: -1.2978
Current minimum: -1.6533
Iteration No: 142 started. Searching for the next optimal point.
Iteration No: 142 ended. Search finished for the next optimal point.
Time taken: 1.7256
Function value obtained: -1.6843
Current minimum: -1.6843
Iteration No: 143 started. Searching for the next optimal point.
Iteration No: 143 ended. Search finished for the next optimal point.
Time taken: 1.6885
Function value obtained: -0.7780
Current minimum: -1.6843
Iteration No: 144 started. Searching for the next optimal point.
Iteration No: 144 ended. Search finished for the next optimal point.
Time taken: 1.7210
Function value obtained: -1.0255
Current minimum: -1.6843
Iteration No: 145 started. Searching for the next optimal point.
Iteration No: 145 ended. Search finished for the next optimal point.
Time taken: 1.6582
Function value obtained: -0.6620
Current minimum: -1.6843
Iteration No: 146 started. Searching for the next optimal point.
Iteration No: 146 ended. Search finished for the next optimal point.
Time taken: 1.7268
Function value obtained: -0.9537
Current minimum: -1.6843
Iteration No: 147 started. Searching for the next optimal point.
Iteration No: 147 ended. Search finished for the next optimal point.
Time taken: 1.7652
Function value obtained: -1.2921
Current minimum: -1.6843
Iteration No: 148 started. Searching for the next optimal point.
Iteration No: 148 ended. Search finished for the next optimal point.
Time taken: 1.9368
Function value obtained: -1.5254
Current minimum: -1.6843
Iteration No: 149 started. Searching for the next optimal point.
Iteration No: 149 ended. Search finished for the next optimal point.
Time taken: 1.6841
Function value obtained: -1.2536
Current minimum: -1.6843
Iteration No: 150 started. Searching for the next optimal point.
Iteration No: 150 ended. Search finished for the next optimal point.
Time taken: 1.7396
Function value obtained: -0.2424
Current minimum: -1.6843
Iteration No: 151 started. Searching for the next optimal point.
Iteration No: 151 ended. Search finished for the next optimal point.
Time taken: 1.8393
Function value obtained: -0.3599
Current minimum: -1.6843
Iteration No: 152 started. Searching for the next optimal point.
Iteration No: 152 ended. Search finished for the next optimal point.
Time taken: 1.8224
Function value obtained: -0.5132
Current minimum: -1.6843
Iteration No: 153 started. Searching for the next optimal point.
Iteration No: 153 ended. Search finished for the next optimal point.
Time taken: 1.7085
Function value obtained: -1.2677
Current minimum: -1.6843
Iteration No: 154 started. Searching for the next optimal point.
Iteration No: 154 ended. Search finished for the next optimal point.
Time taken: 1.7298
Function value obtained: -1.1058
Current minimum: -1.6843
Iteration No: 155 started. Searching for the next optimal point.
Iteration No: 155 ended. Search finished for the next optimal point.
Time taken: 1.7194
Function value obtained: -1.2150
Current minimum: -1.6843
Iteration No: 156 started. Searching for the next optimal point.
Iteration No: 156 ended. Search finished for the next optimal point.
Time taken: 1.6052
Function value obtained: -0.8481
Current minimum: -1.6843
Iteration No: 157 started. Searching for the next optimal point.
Iteration No: 157 ended. Search finished for the next optimal point.
Time taken: 1.7785
Function value obtained: -0.2522
Current minimum: -1.6843
Iteration No: 158 started. Searching for the next optimal point.
Iteration No: 158 ended. Search finished for the next optimal point.
Time taken: 1.8267
Function value obtained: -0.5556
Current minimum: -1.6843
Iteration No: 159 started. Searching for the next optimal point.
Iteration No: 159 ended. Search finished for the next optimal point.
Time taken: 1.8633
Function value obtained: -1.1772
Current minimum: -1.6843
Iteration No: 160 started. Searching for the next optimal point.
Iteration No: 160 ended. Search finished for the next optimal point.
Time taken: 1.8393
Function value obtained: -1.0478
Current minimum: -1.6843
Iteration No: 161 started. Searching for the next optimal point.
Iteration No: 161 ended. Search finished for the next optimal point.
Time taken: 1.8288
Function value obtained: -0.4101
Current minimum: -1.6843
Iteration No: 162 started. Searching for the next optimal point.
Iteration No: 162 ended. Search finished for the next optimal point.
Time taken: 1.8479
Function value obtained: -1.6448
Current minimum: -1.6843
Iteration No: 163 started. Searching for the next optimal point.
Iteration No: 163 ended. Search finished for the next optimal point.
Time taken: 1.8519
Function value obtained: -0.6035
Current minimum: -1.6843
Iteration No: 164 started. Searching for the next optimal point.
Iteration No: 164 ended. Search finished for the next optimal point.
Time taken: 1.7363
Function value obtained: -1.2804
Current minimum: -1.6843
Iteration No: 165 started. Searching for the next optimal point.
Iteration No: 165 ended. Search finished for the next optimal point.
Time taken: 1.7888
Function value obtained: -0.9202
Current minimum: -1.6843
Iteration No: 166 started. Searching for the next optimal point.
Iteration No: 166 ended. Search finished for the next optimal point.
Time taken: 1.7863
Function value obtained: -1.3259
Current minimum: -1.6843
Iteration No: 167 started. Searching for the next optimal point.
Iteration No: 167 ended. Search finished for the next optimal point.
Time taken: 1.7076
Function value obtained: -1.1283
Current minimum: -1.6843
Iteration No: 168 started. Searching for the next optimal point.
Iteration No: 168 ended. Search finished for the next optimal point.
Time taken: 1.8028
Function value obtained: -0.7863
Current minimum: -1.6843
Iteration No: 169 started. Searching for the next optimal point.
Iteration No: 169 ended. Search finished for the next optimal point.
Time taken: 1.7456
Function value obtained: -0.5784
Current minimum: -1.6843
Iteration No: 170 started. Searching for the next optimal point.
Iteration No: 170 ended. Search finished for the next optimal point.
Time taken: 1.8006
Function value obtained: -0.5683
Current minimum: -1.6843
Iteration No: 171 started. Searching for the next optimal point.
Iteration No: 171 ended. Search finished for the next optimal point.
Time taken: 1.8228
Function value obtained: -1.3717
Current minimum: -1.6843
Iteration No: 172 started. Searching for the next optimal point.
Iteration No: 172 ended. Search finished for the next optimal point.
Time taken: 1.7086
Function value obtained: -1.2707
Current minimum: -1.6843
Iteration No: 173 started. Searching for the next optimal point.
Iteration No: 173 ended. Search finished for the next optimal point.
Time taken: 1.9280
Function value obtained: -0.7453
Current minimum: -1.6843
Iteration No: 174 started. Searching for the next optimal point.
Iteration No: 174 ended. Search finished for the next optimal point.
Time taken: 1.9599
Function value obtained: -0.5960
Current minimum: -1.6843
Iteration No: 175 started. Searching for the next optimal point.
Iteration No: 175 ended. Search finished for the next optimal point.
Time taken: 1.8114
Function value obtained: -0.2744
Current minimum: -1.6843
Iteration No: 176 started. Searching for the next optimal point.
Iteration No: 176 ended. Search finished for the next optimal point.
Time taken: 1.9012
Function value obtained: -0.8892
Current minimum: -1.6843
Iteration No: 177 started. Searching for the next optimal point.
Iteration No: 177 ended. Search finished for the next optimal point.
Time taken: 1.7986
Function value obtained: -0.5976
Current minimum: -1.6843
Iteration No: 178 started. Searching for the next optimal point.
Iteration No: 178 ended. Search finished for the next optimal point.
Time taken: 1.8245
Function value obtained: -0.3016
Current minimum: -1.6843
Iteration No: 179 started. Searching for the next optimal point.
Iteration No: 179 ended. Search finished for the next optimal point.
Time taken: 1.8182
Function value obtained: -0.2835
Current minimum: -1.6843
Iteration No: 180 started. Searching for the next optimal point.
Iteration No: 180 ended. Search finished for the next optimal point.
Time taken: 1.9420
Function value obtained: -0.3354
Current minimum: -1.6843
Iteration No: 181 started. Searching for the next optimal point.
Iteration No: 181 ended. Search finished for the next optimal point.
Time taken: 1.9225
Function value obtained: -0.8471
Current minimum: -1.6843
Iteration No: 182 started. Searching for the next optimal point.
Iteration No: 182 ended. Search finished for the next optimal point.
Time taken: 1.7940
Function value obtained: -1.3808
Current minimum: -1.6843
Iteration No: 183 started. Searching for the next optimal point.
Iteration No: 183 ended. Search finished for the next optimal point.
Time taken: 2.0099
Function value obtained: -0.2762
Current minimum: -1.6843
Iteration No: 184 started. Searching for the next optimal point.
Iteration No: 184 ended. Search finished for the next optimal point.
Time taken: 1.7499
Function value obtained: -0.8845
Current minimum: -1.6843
Iteration No: 185 started. Searching for the next optimal point.
Iteration No: 185 ended. Search finished for the next optimal point.
Time taken: 1.9217
Function value obtained: -1.3741
Current minimum: -1.6843
Iteration No: 186 started. Searching for the next optimal point.
Iteration No: 186 ended. Search finished for the next optimal point.
Time taken: 1.8008
Function value obtained: -0.8041
Current minimum: -1.6843
Iteration No: 187 started. Searching for the next optimal point.
Iteration No: 187 ended. Search finished for the next optimal point.
Time taken: 1.9288
Function value obtained: -0.7722
Current minimum: -1.6843
Iteration No: 188 started. Searching for the next optimal point.
Iteration No: 188 ended. Search finished for the next optimal point.
Time taken: 1.9888
Function value obtained: -1.1958
Current minimum: -1.6843
Iteration No: 189 started. Searching for the next optimal point.
Iteration No: 189 ended. Search finished for the next optimal point.
Time taken: 1.8197
Function value obtained: -1.4566
Current minimum: -1.6843
Iteration No: 190 started. Searching for the next optimal point.
Iteration No: 190 ended. Search finished for the next optimal point.
Time taken: 1.9297
Function value obtained: -0.4901
Current minimum: -1.6843
Iteration No: 191 started. Searching for the next optimal point.
Iteration No: 191 ended. Search finished for the next optimal point.
Time taken: 1.8360
Function value obtained: -0.8818
Current minimum: -1.6843
Iteration No: 192 started. Searching for the next optimal point.
Iteration No: 192 ended. Search finished for the next optimal point.
Time taken: 1.9393
Function value obtained: -0.9274
Current minimum: -1.6843
Iteration No: 193 started. Searching for the next optimal point.
Iteration No: 193 ended. Search finished for the next optimal point.
Time taken: 2.0269
Function value obtained: -1.2284
Current minimum: -1.6843
Iteration No: 194 started. Searching for the next optimal point.
Iteration No: 194 ended. Search finished for the next optimal point.
Time taken: 1.8796
Function value obtained: -0.7016
Current minimum: -1.6843
Iteration No: 195 started. Searching for the next optimal point.
Iteration No: 195 ended. Search finished for the next optimal point.
Time taken: 1.8187
Function value obtained: -1.4800
Current minimum: -1.6843
Iteration No: 196 started. Searching for the next optimal point.
Iteration No: 196 ended. Search finished for the next optimal point.
Time taken: 1.9988
Function value obtained: -0.5783
Current minimum: -1.6843
Iteration No: 197 started. Searching for the next optimal point.
Iteration No: 197 ended. Search finished for the next optimal point.
Time taken: 2.0304
Function value obtained: -1.6439
Current minimum: -1.6843
Iteration No: 198 started. Searching for the next optimal point.
Iteration No: 198 ended. Search finished for the next optimal point.
Time taken: 2.0540
Function value obtained: -1.2796
Current minimum: -1.6843
Iteration No: 199 started. Searching for the next optimal point.
Iteration No: 199 ended. Search finished for the next optimal point.
Time taken: 1.9356
Function value obtained: -1.2481
Current minimum: -1.6843
Iteration No: 200 started. Searching for the next optimal point.
Iteration No: 200 ended. Search finished for the next optimal point.
Time taken: 1.8568
Function value obtained: -1.3188
Current minimum: -1.6843
Iteration No: 201 started. Searching for the next optimal point.
Iteration No: 201 ended. Search finished for the next optimal point.
Time taken: 1.9032
Function value obtained: -0.4450
Current minimum: -1.6843
Iteration No: 202 started. Searching for the next optimal point.
Iteration No: 202 ended. Search finished for the next optimal point.
Time taken: 2.0741
Function value obtained: -1.5269
Current minimum: -1.6843
Iteration No: 203 started. Searching for the next optimal point.
Iteration No: 203 ended. Search finished for the next optimal point.
Time taken: 1.9247
Function value obtained: -0.1797
Current minimum: -1.6843
Iteration No: 204 started. Searching for the next optimal point.
Iteration No: 204 ended. Search finished for the next optimal point.
Time taken: 2.0103
Function value obtained: -0.2563
Current minimum: -1.6843
Iteration No: 205 started. Searching for the next optimal point.
Iteration No: 205 ended. Search finished for the next optimal point.
Time taken: 1.9892
Function value obtained: -1.5407
Current minimum: -1.6843
Iteration No: 206 started. Searching for the next optimal point.
Iteration No: 206 ended. Search finished for the next optimal point.
Time taken: 1.9316
Function value obtained: -1.1559
Current minimum: -1.6843
Iteration No: 207 started. Searching for the next optimal point.
Iteration No: 207 ended. Search finished for the next optimal point.
Time taken: 1.9844
Function value obtained: -0.8694
Current minimum: -1.6843
Iteration No: 208 started. Searching for the next optimal point.
Iteration No: 208 ended. Search finished for the next optimal point.
Time taken: 1.9928
Function value obtained: -0.6099
Current minimum: -1.6843
Iteration No: 209 started. Searching for the next optimal point.
Iteration No: 209 ended. Search finished for the next optimal point.
Time taken: 1.9868
Function value obtained: -0.7559
Current minimum: -1.6843
Iteration No: 210 started. Searching for the next optimal point.
Iteration No: 210 ended. Search finished for the next optimal point.
Time taken: 1.8957
Function value obtained: -1.6035
Current minimum: -1.6843
Iteration No: 211 started. Searching for the next optimal point.
Iteration No: 211 ended. Search finished for the next optimal point.
Time taken: 1.9136
Function value obtained: -1.2053
Current minimum: -1.6843
Iteration No: 212 started. Searching for the next optimal point.
Iteration No: 212 ended. Search finished for the next optimal point.
Time taken: 1.9998
Function value obtained: -0.2487
Current minimum: -1.6843
Iteration No: 213 started. Searching for the next optimal point.
Iteration No: 213 ended. Search finished for the next optimal point.
Time taken: 1.8792
Function value obtained: -1.5472
Current minimum: -1.6843
Iteration No: 214 started. Searching for the next optimal point.
Iteration No: 214 ended. Search finished for the next optimal point.
Time taken: 1.9379
Function value obtained: -0.4974
Current minimum: -1.6843
Iteration No: 215 started. Searching for the next optimal point.
Iteration No: 215 ended. Search finished for the next optimal point.
Time taken: 1.9546
Function value obtained: -0.1816
Current minimum: -1.6843
Iteration No: 216 started. Searching for the next optimal point.
Iteration No: 216 ended. Search finished for the next optimal point.
Time taken: 1.9515
Function value obtained: -1.2115
Current minimum: -1.6843
Iteration No: 217 started. Searching for the next optimal point.
Iteration No: 217 ended. Search finished for the next optimal point.
Time taken: 2.2255
Function value obtained: -1.1268
Current minimum: -1.6843
Iteration No: 218 started. Searching for the next optimal point.
Iteration No: 218 ended. Search finished for the next optimal point.
Time taken: 1.9495
Function value obtained: -0.8316
Current minimum: -1.6843
Iteration No: 219 started. Searching for the next optimal point.
Iteration No: 219 ended. Search finished for the next optimal point.
Time taken: 2.0719
Function value obtained: -1.2700
Current minimum: -1.6843
Iteration No: 220 started. Searching for the next optimal point.
Iteration No: 220 ended. Search finished for the next optimal point.
Time taken: 1.9733
Function value obtained: -0.6312
Current minimum: -1.6843
Iteration No: 221 started. Searching for the next optimal point.
Iteration No: 221 ended. Search finished for the next optimal point.
Time taken: 1.9804
Function value obtained: -1.2322
Current minimum: -1.6843
Iteration No: 222 started. Searching for the next optimal point.
Iteration No: 222 ended. Search finished for the next optimal point.
Time taken: 1.9854
Function value obtained: -1.2544
Current minimum: -1.6843
Iteration No: 223 started. Searching for the next optimal point.
Iteration No: 223 ended. Search finished for the next optimal point.
Time taken: 1.8840
Function value obtained: -1.4262
Current minimum: -1.6843
Iteration No: 224 started. Searching for the next optimal point.
Iteration No: 224 ended. Search finished for the next optimal point.
Time taken: 1.9572
Function value obtained: -1.5020
Current minimum: -1.6843
Iteration No: 225 started. Searching for the next optimal point.
Iteration No: 225 ended. Search finished for the next optimal point.
Time taken: 2.0389
Function value obtained: -1.1237
Current minimum: -1.6843
Iteration No: 226 started. Searching for the next optimal point.
Iteration No: 226 ended. Search finished for the next optimal point.
Time taken: 1.9423
Function value obtained: -0.7514
Current minimum: -1.6843
Iteration No: 227 started. Searching for the next optimal point.
Iteration No: 227 ended. Search finished for the next optimal point.
Time taken: 2.0146
Function value obtained: -1.3544
Current minimum: -1.6843
Iteration No: 228 started. Searching for the next optimal point.
Iteration No: 228 ended. Search finished for the next optimal point.
Time taken: 1.9639
Function value obtained: -0.6648
Current minimum: -1.6843
Iteration No: 229 started. Searching for the next optimal point.
Iteration No: 229 ended. Search finished for the next optimal point.
Time taken: 2.0031
Function value obtained: -1.5780
Current minimum: -1.6843
Iteration No: 230 started. Searching for the next optimal point.
Iteration No: 230 ended. Search finished for the next optimal point.
Time taken: 2.1775
Function value obtained: -1.3460
Current minimum: -1.6843
Iteration No: 231 started. Searching for the next optimal point.
Iteration No: 231 ended. Search finished for the next optimal point.
Time taken: 2.1843
Function value obtained: -0.8827
Current minimum: -1.6843
Iteration No: 232 started. Searching for the next optimal point.
Iteration No: 232 ended. Search finished for the next optimal point.
Time taken: 1.9746
Function value obtained: -0.5278
Current minimum: -1.6843
Iteration No: 233 started. Searching for the next optimal point.
Iteration No: 233 ended. Search finished for the next optimal point.
Time taken: 1.9773
Function value obtained: -0.3101
Current minimum: -1.6843
Iteration No: 234 started. Searching for the next optimal point.
Iteration No: 234 ended. Search finished for the next optimal point.
Time taken: 1.9896
Function value obtained: -1.2086
Current minimum: -1.6843
Iteration No: 235 started. Searching for the next optimal point.
Iteration No: 235 ended. Search finished for the next optimal point.
Time taken: 2.0932
Function value obtained: -1.5296
Current minimum: -1.6843
Iteration No: 236 started. Searching for the next optimal point.
Iteration No: 236 ended. Search finished for the next optimal point.
Time taken: 1.9486
Function value obtained: -0.3033
Current minimum: -1.6843
Iteration No: 237 started. Searching for the next optimal point.
Iteration No: 237 ended. Search finished for the next optimal point.
Time taken: 1.9235
Function value obtained: -1.5147
Current minimum: -1.6843
Iteration No: 238 started. Searching for the next optimal point.
Iteration No: 238 ended. Search finished for the next optimal point.
Time taken: 2.0935
Function value obtained: -1.1041
Current minimum: -1.6843
Iteration No: 239 started. Searching for the next optimal point.
Iteration No: 239 ended. Search finished for the next optimal point.
Time taken: 1.9340
Function value obtained: -0.3968
Current minimum: -1.6843
Iteration No: 240 started. Searching for the next optimal point.
Iteration No: 240 ended. Search finished for the next optimal point.
Time taken: 2.1179
Function value obtained: -1.5864
Current minimum: -1.6843
Iteration No: 241 started. Searching for the next optimal point.
Iteration No: 241 ended. Search finished for the next optimal point.
Time taken: 2.2127
Function value obtained: -1.3107
Current minimum: -1.6843
Iteration No: 242 started. Searching for the next optimal point.
Iteration No: 242 ended. Search finished for the next optimal point.
Time taken: 1.9663
Function value obtained: -0.3821
Current minimum: -1.6843
Iteration No: 243 started. Searching for the next optimal point.
Iteration No: 243 ended. Search finished for the next optimal point.
Time taken: 2.0237
Function value obtained: -1.5840
Current minimum: -1.6843
Iteration No: 244 started. Searching for the next optimal point.
Iteration No: 244 ended. Search finished for the next optimal point.
Time taken: 1.9905
Function value obtained: 0.2157
Current minimum: -1.6843
Iteration No: 245 started. Searching for the next optimal point.
Iteration No: 245 ended. Search finished for the next optimal point.
Time taken: 2.1058
Function value obtained: -1.6528
Current minimum: -1.6843
Iteration No: 246 started. Searching for the next optimal point.
Iteration No: 246 ended. Search finished for the next optimal point.
Time taken: 2.1600
Function value obtained: -0.9801
Current minimum: -1.6843
Iteration No: 247 started. Searching for the next optimal point.
Iteration No: 247 ended. Search finished for the next optimal point.
Time taken: 2.1431
Function value obtained: -1.5436
Current minimum: -1.6843
Iteration No: 248 started. Searching for the next optimal point.
Iteration No: 248 ended. Search finished for the next optimal point.
Time taken: 2.0488
Function value obtained: -0.5629
Current minimum: -1.6843
Iteration No: 249 started. Searching for the next optimal point.
Iteration No: 249 ended. Search finished for the next optimal point.
Time taken: 2.1159
Function value obtained: -0.1949
Current minimum: -1.6843
Iteration No: 250 started. Searching for the next optimal point.
Iteration No: 250 ended. Search finished for the next optimal point.
Time taken: 2.1115
Function value obtained: -0.1387
Current minimum: -1.6843

Results


In [6]:
x = opt_res.x_iters
y = opt_res.func_vals
x_random_start = x[:n_random_start]
y_random_start = y[:n_random_start]

In [7]:
fig, ax = plt.subplots(figsize=(8, 5))
plot_func(func, xmin, xmax, ax=ax)
ax2 = ax.twinx()
ax2.set_ylabel("$\mathbb{E}I(x)$")
ax.plot(x_random_start, y_random_start, 'b.', label='Random-start')

def init():
    line_acq, = ax2.plot([], [], "y", label="$\mathbb{E}I(x)$")
    line_iter, = ax.plot([], [], 'r.', label='Iterations')
    line_quant, = ax.plot([], [], 'r-', label='Estimated quantile')
    line_min, = ax.plot([], [], 'mo', markersize=13, label='Minimum')
    return (line_acq, line_iter, line_quant, line_min, )

line_acq, line_iter, line_quant, line_min = init()

ax.legend(loc=0)
fig.tight_layout()



In [8]:
x_plot = np.linspace(xmin, xmax, 100)

def animate(i):
    model_i = opt_res.models[i]
    q_i = model_i.predict(x_plot[:, np.newaxis])
    acq = gaussian_ei(x_plot[:, np.newaxis], model_i, y_opt=np.min(q_i))
    x_iter = x[n_random_start:n_random_start+i+1]
    y_iter = y[n_random_start:n_random_start+i+1]
    id_min = q_i.argmin()
    x_min = x_plot[id_min]
    q_min = q_i[id_min]
    
    line_acq.set_data(x_plot, acq)
    line_iter.set_data(x_iter, y_iter)
    line_quant.set_data(x_plot, q_i)
    line_min.set_data(x_min, q_min)
    ax.title.set_text('n_start = %d - iteration %d' % (n_random_start, i+1))
    print(i)
    return (line_acq, line_iter, line_min, )

In [9]:
from matplotlib import animation

# call the animator. blit=True means only re-draw the parts that 
# have changed.
anim = animation.FuncAnimation(fig, animate, init_func=init,
                               frames=n_iter, interval=1, blit=True)

In [10]:
filename = 'bayesian_optim_ns_%d_niter_%d_%s.gif' % (n_random_start, n_iter, acq_func)

anim.save(filename, writer='imagemagick', fps=2)


0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199

In [ ]: