def EI(params, means, stand_devi, parms_done, y, n_iterations, k):
"""
Expected Improvement acquisition function
:param params: test data
:param means: GP posterior mean
:param stand_devi: standard deviation
:param parms_done: training data
:param y: training targets
:return: next point that need to pick up
"""
s = 0.0005 # small value
max_mean = np.max(y)
f_max = max_mean + s
z = (means - f_max) / stand_devi
EI_vector = (means - f_max) * norm.cdf(z) + stand_devi * norm.pdf(z)
max_index = np.where(EI_vector == np.max(EI_vector))
next_point = params[max_index]
if k == n_iterations-1:
plt.subplot(2, 1, 2)
plt.plot(params, EI_vector, label='EI')
plt.legend(loc=3)
return next_point
tune_hyperparms_regression.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录