Exemple #1
0
from HDMR import RBF_HDMR
from Objective_function import Func_Nd
from collections import OrderedDict
import numpy as np
from pyGPGO.GPGO import GPGO
from pyGPGO.surrogates.GaussianProcess import GaussianProcess
from pyGPGO.acquisition import Acquisition
from pyGPGO.covfunc import matern52
import warnings

f_objective = Func_Nd.Gaussian_mixture_function(input_dim=5)
rbf_hdmr = RBF_HDMR.Rbf_Hdmr(f_objective)

# 其变量取值区间
x_round = f_objective.bounds

# 计算x0,f0。第一种选择方法,随机选取
x0, f0 = rbf_hdmr.x0_fx0()
print('center cut point:', x0)
print('center cut function', f0)

point_round, f_values, type_fx, xishu_arr = rbf_hdmr.func_DEMO()

print('**************************一阶函数模型参数*******************************')

print('采集点', point_round)
# print('采集点的函数值', f_values)
print('type_fx', type_fx)
# print('系数矩阵', xishu_arr)
# 查看一阶模型的精度情况
is_True = rbf_hdmr.simulation_func()
Exemple #2
0
from Objective_function import Func_Nd

from collections import OrderedDict
import numpy as np
from pyGPGO.GPGO import GPGO
from pyGPGO.surrogates.GaussianProcess import GaussianProcess
from pyGPGO.acquisition import Acquisition
from pyGPGO.covfunc import matern52
import warnings

warnings.filterwarnings('ignore')

# 函数
dim = 10
f_objective = Func_Nd.Schwefel_Func(input_dim=dim)
x_round = f_objective.bounds

X2 = [0.5] * dim
print(f_objective.f(X2))