Skip to content

Commit c736a30

Browse files
authored
Merge pull request #286 from theahura/patch-3
Use combined_score for target_score analysis instead of an average of all numeric scores
2 parents 78c43bb + e6845ee commit c736a30

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

openevolve/process_parallel.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -586,16 +586,12 @@ async def run_evolution(
586586

587587
# Check target score
588588
if target_score is not None and child_program.metrics:
589-
numeric_metrics = [
590-
v for v in child_program.metrics.values() if isinstance(v, (int, float))
591-
]
592-
if numeric_metrics:
593-
avg_score = sum(numeric_metrics) / len(numeric_metrics)
594-
if avg_score >= target_score:
595-
logger.info(
596-
f"Target score {target_score} reached at iteration {completed_iteration}"
597-
)
598-
break
589+
if ('combined_score' in child_program.metrics and
590+
child_program.metrics['combined_score'] >= target_score):
591+
logger.info(
592+
f"Target score {target_score} reached at iteration {completed_iteration}"
593+
)
594+
break
599595

600596
# Check early stopping
601597
if early_stopping_enabled and child_program.metrics:

0 commit comments

Comments
 (0)