Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
8f44d1a
1
Parent(s):
44b1333
Improve hyperopt
Browse files- hyperparamopt.py +7 -2
hyperparamopt.py
CHANGED
@@ -37,9 +37,14 @@ def run_trial(args):
|
|
37 |
for key in 'niterations npop'.split(' '):
|
38 |
args[key] = int(args[key])
|
39 |
|
40 |
-
|
|
|
41 |
niterations = args['niterations']
|
42 |
npop = args['npop']
|
|
|
|
|
|
|
|
|
43 |
args['ncyclesperiteration'] = int(total_steps / (niterations * npop))
|
44 |
args['topn'] = 10
|
45 |
args['parsimony'] = 1e-3
|
@@ -52,7 +57,7 @@ def run_trial(args):
|
|
52 |
|
53 |
args['weightDoNothing'] = 1.0
|
54 |
|
55 |
-
maxTime =
|
56 |
ntrials = 2
|
57 |
equation_file = f'.hall_of_fame_{np.random.rand():f}.csv'
|
58 |
|
|
|
37 |
for key in 'niterations npop'.split(' '):
|
38 |
args[key] = int(args[key])
|
39 |
|
40 |
+
|
41 |
+
total_steps = 20*100*5000
|
42 |
niterations = args['niterations']
|
43 |
npop = args['npop']
|
44 |
+
if niterations == 0 or npop == 0:
|
45 |
+
print("Bad parameters")
|
46 |
+
return {'status': 'ok', 'loss': np.inf}
|
47 |
+
|
48 |
args['ncyclesperiteration'] = int(total_steps / (niterations * npop))
|
49 |
args['topn'] = 10
|
50 |
args['parsimony'] = 1e-3
|
|
|
57 |
|
58 |
args['weightDoNothing'] = 1.0
|
59 |
|
60 |
+
maxTime = 3*60
|
61 |
ntrials = 2
|
62 |
equation_file = f'.hall_of_fame_{np.random.rand():f}.csv'
|
63 |
|