-
Notifications
You must be signed in to change notification settings - Fork 26
CurrinExp Prior
In this example, we show how to use HyperMapper's prior injection in the optimization of the CurrinExp function. We look for minimizing the value of this function given two parameters x1, x2.
The CurrinExp objective function can be defined as:
factor1 = 1 - math.exp(-1/(2*x2))
factor2 = 2300*x1*x1*x1 + 1900*x1*x1 + 2092*x1 + 60
factor3 = 100*x1*x1*x1 + 500*x1*x1 + 4*x1 + 20
y_value = factor1*factor2/factor3
An example of this code can be found in prior_currinexp.py.
In this example, we inject priors into optimization. Since the CurrinExp function has its optimum at X = [0, 1]
, we use decay and exponential priors for the input parameters. The json configuration file for this example is:
{
"application_name": "currinexp",
"optimization_objectives": ["Value"],
"optimization_iterations": 20,
"design_of_experiment":{
"number_of_samples": 3
},
"input_parameters" : {
"x1": {
"parameter_type" : "real",
"values" : [0, 1],
"prior" : "decay"
},
"x2": {
"parameter_type" : "real",
"values" : [0.00001, 1],
"prior" : "exponential"
}
}
}
Note that the only addition to the json are the priors for the input parameters, defined with "prior": "decay"
and "prior": "exponential"
. You can find this json in prior_currinexp_scenario.json. See here for more information on prior injection and the supported prior types.
In order to run this example, we use:
python3 example_scenarios/synthetic/currinexp/currinexp.py
An example of stdout output can be found here.
The result of this script is a csv file called prior_currinexp_output_samples.csv.