HIPS / Spearmint

Spearmint Bayesian optimization codebase
Other
1.54k stars 328 forks source link

Stopping after max_iterations #77

Closed weissercn closed 7 years ago

weissercn commented 7 years ago

Is there a way to stop execution of the program is say 50 iterations are reached? If not, could someone suggest a quick workaround?

hzhangxyz commented 7 years ago

It is a "while True:" in main.py (line 81) maybe if you want, you can change it manually to sth like it:

while len(load_jobs(db, experiment_name))>=50:
ili3p commented 7 years ago

It's the max-finished-jobs property in the configuration json. Example config.json file:


{
    "resources" : {
      "my-machine" : {
        "scheduler"         : "local",
        "max-concurrent"    : 1,
        "max-finished-jobs" : 200
     }
     },
    "language"        : "PYTHON",
    "main-file"       : "branin.py",
    "experiment-name" : "simple-braninhoo-example",
    "likelihood"      : "NOISELESS",
    "variables" : {
        "x" : {
            "type" : "FLOAT",
            "size" : 1,
            "min"  : -5,
            "max"  : 10
        },
        "y" : {
            "type" : "FLOAT",
            "size" : 1,
            "min"  : 0,
            "max"  : 15
        }
    }
}