44"""
55
66import pymzn
7- pymzn .config .set ('solver' , pymzn .Gurobi (dll = 'gurobi80' ))
8- pymzn .config .set ('no_output_annotations' , True )
7+ pymzn .config .no_output_annotations = True
98
109from time import time
1110from pyconstruct import Domain , SSG
1615from sklearn .model_selection import train_test_split
1716
1817
19- def loss (Y_pred , Y_true , n_jobs = 4 ):
18+ def loss (Y_pred , Y_true , n_jobs = 1 ):
2019 return hamming (
2120 Y_pred , Y_true , key = 'sequence' , n_jobs = n_jobs
2221 )
@@ -26,7 +25,8 @@ def train(args):
2625
2726 dom = Domain (
2827 args .domain_file , n_jobs = args .parallel ,
29- no_constraints = args .no_constraints
28+ no_constraints = args .no_constraints ,
29+ timeout = 1
3030 )
3131
3232 eq_data = load_equations ()
@@ -91,7 +91,7 @@ def train(args):
9191 parser = argparse .ArgumentParser ()
9292 parser .add_argument ('-D' , '--domain-file' , default = 'equations.pmzn' )
9393 parser .add_argument ('-n' , '--n_samples' , type = int , default = 1000 )
94- parser .add_argument ('-p' , '--parallel' , type = int , default = 4 )
94+ parser .add_argument ('-p' , '--parallel' , type = int , default = 1 )
9595 parser .add_argument ('-N' , '--no-constraints' , action = 'store_true' )
9696 parser .add_argument ('-O' , '--output' , default = 'results.pickle' )
9797 args = parser .parse_args ()
0 commit comments