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

Make hyperopt less sensitive to specific test

Browse files
Files changed (1) hide show
  1. hyperparamopt.py +7 -5
hyperparamopt.py CHANGED
@@ -32,13 +32,14 @@ def run_trial(args):
32
  print("Took too long. Skipping.")
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}",
@@ -49,7 +50,8 @@ def run_trial(args):
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
 
32
  print("Took too long. Skipping.")
33
  raise ValueError("Takes too long")
34
 
35
+ maxTime = 120
36
+ ntrials = 3
37
+ equation_file = f'.hall_of_fame_{np.random.rand():f}.csv'
38
 
39
  try:
40
  trials = []
41
+ for i in range(1, 4):
42
+ subtrials = []
43
  for j in range(ntrials):
44
  trial = eureqa.eureqa(
45
  test=f"simple{i}",
 
50
  timeout=maxTime,
51
  **args)
52
  if len(trial) == 0: raise ValueError
53
+ subtrials.append(np.min(trial['MSE']))
54
+ trials.append(np.log(np.median(subtrials) + 0.1))
55
  except ValueError:
56
  return {
57
  'status': 'ok', # or 'fail' if nan loss