-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from luinardi/prior_guided_optimization
Added prior-guided optimization approach.
- Loading branch information
Showing
12 changed files
with
1,430 additions
and
90 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
example_outputs/synthetic_functions/prior_currinexp/output_prior_currinexp.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
Design of experiment phase, number of doe samples = 3 ....... | ||
x1,x2,Value,Timestamp | ||
0.0711680251749421,0.918860499459033,4.02779694878494,6950 | ||
0.08374201043118659,0.08391745617300503,10.42748160722958,6950 | ||
0.13139443915285315,0.5365545892167386,7.692592659010549,6950 | ||
|
||
|
||
End of doe/resume phase, the number of configuration runs is: 3 | ||
|
||
Starting optimization iteration 1 | ||
x1,x2,Value,Timestamp | ||
0.4509563903201488,0.7069863095345909,6.117712074031937,6965 | ||
|
||
Starting optimization iteration 2 | ||
x1,x2,Value,Timestamp | ||
0.36392434241928656,1.0,5.035876129222752,15253 | ||
|
||
Starting optimization iteration 3 | ||
x1,x2,Value,Timestamp | ||
4.062834327761441e-06,1.0,1.1805742753340724,23483 | ||
|
||
Starting optimization iteration 4 | ||
x1,x2,Value,Timestamp | ||
3.05653254848465e-07,1.0,1.1804205284412628,30936 | ||
|
||
Starting optimization iteration 5 | ||
x1,x2,Value,Timestamp | ||
1.0265688688718155e-05,1.0,1.1808281011384816,38248 | ||
|
||
Starting optimization iteration 6 | ||
x1,x2,Value,Timestamp | ||
1.2548908632819513e-06,1.0,1.1804593720139331,46522 | ||
|
||
Starting optimization iteration 7 | ||
x1,x2,Value,Timestamp | ||
1.778651187016753e-05,1.0,1.1811358592545058,54803 | ||
|
||
Starting optimization iteration 8 | ||
x1,x2,Value,Timestamp | ||
0.3398424549396122,0.362590602351231,9.737453904476649,54820 | ||
|
||
Starting optimization iteration 9 | ||
x1,x2,Value,Timestamp | ||
0.0024892400780651457,1.0,1.282252625178526,63329 | ||
|
||
Starting optimization iteration 10 | ||
x1,x2,Value,Timestamp | ||
0.0006171945147863797,1.0,1.2056637700336026,71662 | ||
|
||
Starting optimization iteration 11 | ||
x1,x2,Value,Timestamp | ||
1.3516466735036529e-05,1.0,1.180961125588085,79518 | ||
|
||
Starting optimization iteration 12 | ||
x1,x2,Value,Timestamp | ||
5.50726757179193e-05,1.0,1.1826616383188775,86852 | ||
|
||
Starting optimization iteration 13 | ||
x1,x2,Value,Timestamp | ||
6.715085215939413e-07,1.0,1.1804354995355162,94167 | ||
|
||
Starting optimization iteration 14 | ||
x1,x2,Value,Timestamp | ||
2.746991426485545e-06,1.0,1.180520429977757,101582 | ||
|
||
Starting optimization iteration 15 | ||
x1,x2,Value,Timestamp | ||
9.88987177950969e-05,1.0,1.1844550326094196,108838 | ||
|
||
Starting optimization iteration 16 | ||
x1,x2,Value,Timestamp | ||
6.517528293725511e-07,1.0,1.1804346911165693,116122 | ||
|
||
Starting optimization iteration 17 | ||
x1,x2,Value,Timestamp | ||
0.014024969093860385,1.0,1.7515590044049345,123734 | ||
|
||
Starting optimization iteration 18 | ||
x1,x2,Value,Timestamp | ||
1.134778693051246e-06,1.0,1.1804544569265605,131117 | ||
|
||
Starting optimization iteration 19 | ||
x1,x2,Value,Timestamp | ||
0.003972875152055387,1.0,1.3429146725521282,138537 | ||
|
||
Starting optimization iteration 20 | ||
x1,x2,Value,Timestamp | ||
2.5976861786358505e-05,1.0,1.181471014894109,145806 | ||
|
||
End of Prior Optimization | ||
### End of the hypermapper script. | ||
End of CurrinExp. |
24 changes: 24 additions & 0 deletions
24
example_outputs/synthetic_functions/prior_currinexp/prior_currinexp_output_samples.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
x1,x2,Value,Timestamp | ||
0.0711680251749421,0.918860499459033,4.02779694878494,6950 | ||
0.08374201043118659,0.08391745617300503,10.42748160722958,6950 | ||
0.13139443915285315,0.5365545892167386,7.692592659010549,6950 | ||
0.4509563903201488,0.7069863095345909,6.117712074031937,6965 | ||
0.36392434241928656,1.0,5.035876129222752,15253 | ||
4.062834327761441e-06,1.0,1.1805742753340724,23483 | ||
3.05653254848465e-07,1.0,1.1804205284412628,30936 | ||
1.0265688688718155e-05,1.0,1.1808281011384816,38248 | ||
1.2548908632819513e-06,1.0,1.1804593720139331,46522 | ||
1.778651187016753e-05,1.0,1.1811358592545058,54803 | ||
0.3398424549396122,0.362590602351231,9.737453904476649,54820 | ||
0.0024892400780651457,1.0,1.282252625178526,63329 | ||
0.0006171945147863797,1.0,1.2056637700336026,71662 | ||
1.3516466735036529e-05,1.0,1.180961125588085,79518 | ||
5.50726757179193e-05,1.0,1.1826616383188775,86852 | ||
6.715085215939413e-07,1.0,1.1804354995355162,94167 | ||
2.746991426485545e-06,1.0,1.180520429977757,101582 | ||
9.88987177950969e-05,1.0,1.1844550326094196,108838 | ||
6.517528293725511e-07,1.0,1.1804346911165693,116122 | ||
0.014024969093860385,1.0,1.7515590044049345,123734 | ||
1.134778693051246e-06,1.0,1.1804544569265605,131117 | ||
0.003972875152055387,1.0,1.3429146725521282,138537 | ||
2.5976861786358505e-05,1.0,1.181471014894109,145806 |
29 changes: 29 additions & 0 deletions
29
example_scenarios/synthetic/prior_currinexp/prior_currinexp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/python | ||
import math, sys | ||
from subprocess import Popen, PIPE | ||
sys.path.append('scripts') | ||
import hypermapper | ||
|
||
def currin_exp_function(X): | ||
""" | ||
Compute the CurrinExp function. | ||
The value is computed as defined in https://www.sfu.ca/~ssurjano/curretal88exp.html | ||
:param X: dictionary containing the input points. | ||
:return: the value of the CurrinExp function. | ||
""" | ||
x1 = X['x1'] | ||
x2 = X['x2'] | ||
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 | ||
|
||
return y_value | ||
|
||
def main(): | ||
parameters_file = "example_scenarios/synthetic/prior_currinexp/prior_currinexp_scenario.json" | ||
hypermapper.optimize(parameters_file, currin_exp_function) | ||
print("End of CurrinExp.") | ||
|
||
if __name__ == "__main__": | ||
main() |
22 changes: 22 additions & 0 deletions
22
example_scenarios/synthetic/prior_currinexp/prior_currinexp_scenario.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"application_name": "prior_currinexp", | ||
"optimization_objectives": ["Value"], | ||
"optimization_iterations": 20, | ||
"optimization_method": "prior_guided_optimization", | ||
"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" | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.