MilesCranmer commited on
Commit
597f1d0
1 Parent(s): 7d1a81e

Average over more tests for hyperparam search

Browse files
Files changed (1) hide show
  1. hyperparamopt.py +13 -12
hyperparamopt.py CHANGED
@@ -33,22 +33,23 @@ def run_trial(args):
33
  raise ValueError("Takes too long")
34
 
35
  maxTime = 60
36
- ntrials = 1 #3
37
  equation_file=f'hall_of_fame_{np.random.rand():f}.csv'
38
 
39
  try:
40
  trials = []
41
- for i in range(1, 2):
42
- trial = eureqa.eureqa(
43
- test=f"simple{i}",
44
- threads=4,
45
- binary_operators=["plus", "mult", "pow", "div"],
46
- unary_operators=["cos", "exp", "sin", "log"],
47
- equation_file=equation_file,
48
- timeout=maxTime,
49
- **args)
50
- if len(trial) == 0: raise ValueError
51
- trials.append([np.min(trial['MSE'])])
 
52
  except ValueError:
53
  return {
54
  'status': 'ok', # or 'fail' if nan loss
 
33
  raise ValueError("Takes too long")
34
 
35
  maxTime = 60
36
+ ntrials = 3 #3
37
  equation_file=f'hall_of_fame_{np.random.rand():f}.csv'
38
 
39
  try:
40
  trials = []
41
+ for i in range(1, 6):
42
+ for j in range(ntrials):
43
+ trial = eureqa.eureqa(
44
+ test=f"simple{i}",
45
+ threads=4,
46
+ binary_operators=["plus", "mult", "pow", "div"],
47
+ unary_operators=["cos", "exp", "sin", "log"],
48
+ equation_file=equation_file,
49
+ timeout=maxTime,
50
+ **args)
51
+ if len(trial) == 0: raise ValueError
52
+ trials.append([np.min(trial['MSE'])])
53
  except ValueError:
54
  return {
55
  'status': 'ok', # or 'fail' if nan loss