Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

True best value in Bayesian Optimization #349

@lewisscola

Description

@lewisscola

Hi,
I have some questions about the true best value in BO. my code is listed as below:

%pylab inline
import GPyOpt
from numpy.random import seed
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
import seaborn as sns

func = GPyOpt.objective_examples.experiments1d.forrester() 
domain =[{'name': 'var1', 'type': 'continuous', 'domain': (0,1)}]

myBopt1 = GPyOpt.methods.BayesianOptimization(f=func.f,             
                                             domain=domain, 
                                             acquisition_type='EI',)

# Run the optimization
max_iter = 40     # evaluation budget
max_time = 60     # time budget 
eps      = 10e-6  # Minimum allows distance between the las two observations

myBopt1.run_optimization(max_iter, max_time, eps)  
myBopt1.plot_acquisition()
print("Value of (x,y) that minimize the objective:"+str(myBopt1.x_opt))    
print("Mninimum value of the objective: "+str(myBopt1.fx_opt)) 

image

Then I plot the predicted best value of BO (myBopt1.Y[:i]) and the final best value of BO( myBopt1.Y)

best1 = myBopt1.Y
best2 = [(min(myBopt1.Y[:i])) for i in range(1, len(myBopt1.Y))]
plt.plot(range(len(best1)), best1)
plt.xlabel('iterations')
plt.ylabel('myBopt1.Y')
plt.show()

image

plt.plot(range(len(best2)), best2)
plt.xlabel('iterations')
plt.ylabel('myBopt1.Y[:i]')
plt.show()

image

My question is why the final best values do not converge as the predicted best values do? Why the final best values fluctuate?
What is the relation between myBopt1.fx_opt and myBopt1.Y?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions