tune_hyperparms_regression.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Gaussian_process 作者: happyjin 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号