-
Notifications
You must be signed in to change notification settings - Fork 56
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 #92 from smohsinali/michalewicz
Add michalewicz test function
- Loading branch information
Showing
14 changed files
with
259 additions
and
0 deletions.
There are no files selected for viewing
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,58 @@ | ||
## | ||
# wrapping: A program making it easy to use hyperparameter | ||
# optimization software. | ||
# Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
__authors__ = ["Mohsin Ali"] | ||
__contact__ = ["automl.org"] | ||
__credits__ = ["Sonja Surjanovic, Derek Bingham,"] | ||
__function__= ["MICHALEWICZ FUNCTION"] | ||
|
||
import time | ||
|
||
import HPOlib.benchmarks.benchmark_util as benchmark_util | ||
|
||
def michal(xx,m): | ||
import math | ||
|
||
d=len(xx); | ||
sum=0; | ||
for ii in range(d): | ||
xi=xx[ii]; | ||
i=ii+1; | ||
new=math.sin(xi) * math.pow((math.sin(i*math.pow(xi,2)/math.pi)),(2*m)); | ||
sum=sum+new; | ||
|
||
return -sum; | ||
|
||
|
||
|
||
def main(params, **kwargs): | ||
print 'Params: ', params; | ||
print 'kwargs: ', kwargs; | ||
|
||
xx=[float(params["x"]),float(params["y"])]; | ||
|
||
y = michal(xx,10); | ||
return y; | ||
|
||
if __name__ == "__main__": | ||
starttime = time.time() | ||
args, params = benchmark_util.parse_cli() | ||
result = main(params, **args) | ||
duration = time.time() - starttime | ||
print "Result for ParamILS: %s, %f, 1, %f, %d, %s" % \ | ||
("SAT", abs(duration), result, -1, str(__file__)) |
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 @@ | ||
smac_2_06_01-dev |
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 @@ | ||
smac_2_08_00-master |
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 @@ | ||
smac_2_10_00-dev |
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,2 @@ | ||
__authors__ = ["Katharina Eggensperger", "Matthias Feurer"] | ||
__contact__ = "automl.org" |
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,14 @@ | ||
[SMAC] | ||
p = params.pcs | ||
|
||
[TPE] | ||
space = space.py | ||
|
||
[SPEARMINT] | ||
config = config.pb | ||
|
||
[HPOLIB] | ||
console_output_delay = 2.0 | ||
function = python ../michalewicz.py | ||
number_of_jobs = 50 | ||
result_on_terminate = 3 |
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,13 @@ | ||
from hyperopt import hp | ||
|
||
space = {'x1': hp.uniform('x1', 0, 3.14159265359), | ||
'x2': hp.uniform('x2', 0, 3.14159265359), | ||
'x3': hp.uniform('x3', 0, 3.14159265359), | ||
'x4': hp.uniform('x4', 0, 3.14159265359), | ||
'x5': hp.uniform('x5', 0, 3.14159265359), | ||
'x6': hp.uniform('x6', 0, 3.14159265359), | ||
'x7': hp.uniform('x7', 0, 3.14159265359), | ||
'x8': hp.uniform('x8', 0, 3.14159265359), | ||
'x9': hp.uniform('x9', 0, 3.14159265359), | ||
'x10': hp.uniform('x10', 0, 3.14159265359) | ||
} |
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,62 @@ | ||
## | ||
# wrapping: A program making it easy to use hyperparameter | ||
# optimization software. | ||
# Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
__authors__ = ["Mohsin Ali"] | ||
__contact__ = ["automl.org"] | ||
__credits__ = ["Sonja Surjanovic", "Derek Bingham",] | ||
__function__= ["MICHALEWICZ FUNCTION"] | ||
|
||
import time | ||
|
||
import HPOlib.benchmarks.benchmark_util as benchmark_util | ||
|
||
def michal(xx,m): | ||
import math | ||
|
||
d=len(xx); | ||
sum=0; | ||
for ii in range(d): | ||
xi=xx[ii]; | ||
i=ii+1; | ||
new=math.sin(xi) * math.pow((math.sin(i*math.pow(xi,2)/math.pi)),(2*m)); | ||
sum=sum+new; | ||
|
||
return -sum; | ||
|
||
|
||
|
||
def main(params, **kwargs): | ||
print 'Params: ', params; | ||
print 'kwargs: ', kwargs; | ||
|
||
xx=[float(params["x1"]),float(params["x2"]), | ||
float(params["x3"]),float(params["x4"]), | ||
float(params["x5"]),float(params["x6"]), | ||
float(params["x7"]),float(params["x8"]), | ||
float(params["x9"]),float(params["x10"]),]; | ||
|
||
y = michal(xx,10); | ||
return y; | ||
|
||
if __name__ == "__main__": | ||
starttime = time.time() | ||
args, params = benchmark_util.parse_cli() | ||
result = main(params, **args) | ||
duration = time.time() - starttime | ||
print "Result for ParamILS: %s, %f, 1, %f, %d, %s" % \ | ||
("SAT", abs(duration), result, -1, str(__file__)) |
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 @@ | ||
hyperopt_august2013_mod/ |
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,10 @@ | ||
x1 real [0, 3.14159265359] [1.7] | ||
x2 real [0, 3.14159265359] [1.7] | ||
x3 real [0, 3.14159265359] [1.7] | ||
x4 real [0, 3.14159265359] [1.7] | ||
x5 real [0, 3.14159265359] [1.7] | ||
x6 real [0, 3.14159265359] [1.7] | ||
x7 real [0, 3.14159265359] [1.7] | ||
x8 real [0, 3.14159265359] [1.7] | ||
x9 real [0, 3.14159265359] [1.7] | ||
x10 real [0, 3.14159265359] [1.7] |
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 @@ | ||
smac_2_06_01-dev/ |
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,10 @@ | ||
x1 real [0, 3.14159265359] [1.7] | ||
x2 real [0, 3.14159265359] [1.7] | ||
x3 real [0, 3.14159265359] [1.7] | ||
x4 real [0, 3.14159265359] [1.7] | ||
x5 real [0, 3.14159265359] [1.7] | ||
x6 real [0, 3.14159265359] [1.7] | ||
x7 real [0, 3.14159265359] [1.7] | ||
x8 real [0, 3.14159265359] [1.7] | ||
x9 real [0, 3.14159265359] [1.7] | ||
x10 real [0, 3.14159265359] [1.7] |
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,84 @@ | ||
language: PYTHON | ||
name: "spearmint_to_HPOlib" | ||
|
||
variable { | ||
name: "x1" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x2" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x3" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x4" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x5" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x6" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x7" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x8" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x9" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
variable { | ||
name: "x10" | ||
type: FLOAT | ||
size: 1 | ||
min: 0 | ||
max: 3.14159265359 | ||
} | ||
|
||
|
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 @@ | ||
spearmint_april2013_mod/ |