From 15ee7f51eeabea77059694e185373e9c8314b7e8 Mon Sep 17 00:00:00 2001 From: Alinson S Xavier Date: Sat, 22 Feb 2020 22:56:53 -0600 Subject: [PATCH] Update benchmark scripts --- benchmark/benchmark.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index d545e29..8aa3387 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -30,6 +30,7 @@ logging.getLogger('pyomo.core').setLevel(logging.ERROR) n_jobs = 10 time_limit = 300 +internal_solver = "gurobi" args = docopt(__doc__) basepath = args[""] @@ -52,9 +53,11 @@ def train(): problem_name, challenge_name = args[""].split("/") pkg = importlib.import_module("miplearn.problems.%s" % problem_name) challenge = getattr(pkg, challenge_name)() - train_instances = challenge.training_instances[:10] - test_instances = challenge.test_instances[:10] - solver = LearningSolver(time_limit=time_limit, components={}) + train_instances = challenge.training_instances + test_instances = challenge.test_instances + solver = LearningSolver(time_limit=time_limit, + solver=internal_solver, + components={}) solver.parallel_solve(train_instances, n_jobs=n_jobs) solver.fit(n_jobs=n_jobs) save(train_instances, "%s/train_instances.bin" % basepath) @@ -157,4 +160,4 @@ if __name__ == "__main__": #if args["test-ml"]: # test_ml() #if args["charts"]: - # charts() \ No newline at end of file + # charts()