Skip to content

Commit 8c1d7bc

Browse files
committed
Update the evaluator.py in function_minimization
the old version of code is: y_std_score = float(1.0 / (1.0 + np.std(x_values))) is not correct I changed to the y_std_score = float(1.0 / (1.0 + np.std(y_values)))
1 parent e152825 commit 8c1d7bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/function_minimization/evaluator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ def evaluate(program_path):
178178
speed_score = float(1.0 / avg_time) if avg_time > 0 else 0.0
179179

180180
# calculate standard deviation scores
181+
# get x_std_score
181182
x_std_score = float(1.0 / (1.0 + np.std(x_values)))
182-
y_std_score = float(1.0 / (1.0 + np.std(x_values)))
183+
# get y_std_score
184+
y_std_score = float(1.0 / (1.0 + np.std(y_values)))
183185
standard_deviation_score = (x_std_score + y_std_score) / 2.0
184186

185187
# Normalize speed score (so it doesn't dominate)
@@ -341,4 +343,4 @@ def evaluate_stage1(program_path):
341343
def evaluate_stage2(program_path):
342344
"""Second stage evaluation with more thorough testing"""
343345
# Full evaluation as in the main evaluate function
344-
return evaluate(program_path)
346+
return evaluate(program_path)

0 commit comments

Comments
 (0)