mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Implement AdaptiveSolver; reorganize imports
This commit is contained in:
@@ -12,13 +12,18 @@ Options:
|
||||
"""
|
||||
from docopt import docopt
|
||||
import importlib, pathlib
|
||||
from miplearn import LearningSolver, BenchmarkRunner
|
||||
from miplearn.warmstart import WarmStartComponent
|
||||
from miplearn.branching import BranchPriorityComponent
|
||||
from miplearn import (LearningSolver,
|
||||
BenchmarkRunner,
|
||||
WarmStartComponent,
|
||||
BranchPriorityComponent,
|
||||
)
|
||||
from numpy import median
|
||||
import pyomo.environ as pe
|
||||
import pickle
|
||||
|
||||
import logging
|
||||
logging.getLogger('pyomo.core').setLevel(logging.ERROR)
|
||||
|
||||
args = docopt(__doc__)
|
||||
basepath = args["<challenge>"]
|
||||
pathlib.Path(basepath).mkdir(parents=True, exist_ok=True)
|
||||
@@ -60,7 +65,7 @@ def train():
|
||||
internal_solver_factory=train_solver_factory,
|
||||
components={
|
||||
"warm-start": WarmStartComponent(),
|
||||
"branch-priority": BranchPriorityComponent(),
|
||||
#"branch-priority": BranchPriorityComponent(),
|
||||
},
|
||||
)
|
||||
solver.parallel_solve(train_instances, n_jobs=10)
|
||||
@@ -89,7 +94,7 @@ def test_ml():
|
||||
internal_solver_factory=test_solver_factory,
|
||||
components={
|
||||
"warm-start": WarmStartComponent(),
|
||||
"branch-priority": BranchPriorityComponent(),
|
||||
#"branch-priority": BranchPriorityComponent(),
|
||||
},
|
||||
),
|
||||
"ml-heuristic": LearningSolver(
|
||||
@@ -97,7 +102,7 @@ def test_ml():
|
||||
mode="heuristic",
|
||||
components={
|
||||
"warm-start": WarmStartComponent(),
|
||||
"branch-priority": BranchPriorityComponent(),
|
||||
#"branch-priority": BranchPriorityComponent(),
|
||||
},
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user