Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/results/metrics.json +32 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/eval_agent_memory/__pycache__/auxiliary_metrics.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/job_log.err +9 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/job_log.out +9 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/metrics.json +22 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/results/metrics.json +19 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/edit.diff +177 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/main.py +127 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/original.py +111 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/results/metrics.json +32 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/search_replace.txt +159 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/results/metrics.json +32 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/results/metrics.json +32 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/edit.diff +276 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/main.py +169 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/original.py +182 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/results/metrics.json +19 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/rewrite.txt +172 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/results/metrics.json +32 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/results/metrics.json +19 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/__pycache__/main.cpython-313.pyc +0 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/results/auxiliary_metrics_snapshot.py +3 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/results/correct.json +4 -0
- tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/results/metrics.json +32 -0
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (11.7 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": true,
|
| 3 |
+
"error": null
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/best/results/metrics.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": -1.5969140188371829,
|
| 3 |
+
"correct": true,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": -1.5969140188371829,
|
| 6 |
+
"public": {
|
| 7 |
+
"best_value": 1.5969140188371829,
|
| 8 |
+
"best_length": 768,
|
| 9 |
+
"num_runs": 1
|
| 10 |
+
},
|
| 11 |
+
"private": {
|
| 12 |
+
"all_values": [
|
| 13 |
+
1.5969140188371829
|
| 14 |
+
],
|
| 15 |
+
"all_lengths": [
|
| 16 |
+
768
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"text_feedback": "Lower evaluate_sequence value is better. combined_score = -best_value.",
|
| 20 |
+
"execution_time_mean": 9.62328302115202,
|
| 21 |
+
"execution_time_std": 0.0,
|
| 22 |
+
"num_valid_runs": 1,
|
| 23 |
+
"num_invalid_runs": 0,
|
| 24 |
+
"all_validation_errors": [],
|
| 25 |
+
"correct": true,
|
| 26 |
+
"validation_error": null
|
| 27 |
+
},
|
| 28 |
+
"auxiliary": {},
|
| 29 |
+
"auxiliary_descriptions": {},
|
| 30 |
+
"timestamp": 1770952577.177127,
|
| 31 |
+
"generation": 72
|
| 32 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/eval_agent_memory/__pycache__/auxiliary_metrics.cpython-313.pyc
ADDED
|
Binary file (442 Bytes). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (5.98 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": true,
|
| 3 |
+
"error": null
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/job_log.err
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/home/tengxiao/pj/ShinkaEvolve/.venv/lib/python3.13/site-packages/instructor/providers/gemini/client.py:5: FutureWarning:
|
| 2 |
+
|
| 3 |
+
All support for the `google.generativeai` package has ended. It will no longer be receiving
|
| 4 |
+
updates or bug fixes. Please switch to the `google.genai` package as soon as possible.
|
| 5 |
+
See README for more details:
|
| 6 |
+
|
| 7 |
+
https://github.com/google-gemini/deprecated-generative-ai-python/blob/main/README.md
|
| 8 |
+
|
| 9 |
+
import google.generativeai as genai # type: ignore[import-not-found]
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/job_log.out
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Evaluating program: tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/main.py
|
| 2 |
+
Saving results to: tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results
|
| 3 |
+
Number of runs: 1
|
| 4 |
+
Running with timeout: 120s
|
| 5 |
+
Run 1/1 completed in 9.82 seconds
|
| 6 |
+
Correctness and error status saved to tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/correct.json
|
| 7 |
+
Metrics saved to tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/metrics.json
|
| 8 |
+
Evaluation completed successfully.
|
| 9 |
+
combined_score=-1.7189562728029888
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_0/results/metrics.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": -1.7189562728029888,
|
| 3 |
+
"public": {
|
| 4 |
+
"best_value": 1.7189562728029888,
|
| 5 |
+
"best_length": 768,
|
| 6 |
+
"num_runs": 1
|
| 7 |
+
},
|
| 8 |
+
"private": {
|
| 9 |
+
"all_values": [
|
| 10 |
+
1.7189562728029888
|
| 11 |
+
],
|
| 12 |
+
"all_lengths": [
|
| 13 |
+
768
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
"text_feedback": "Lower evaluate_sequence value is better. combined_score = -best_value.",
|
| 17 |
+
"execution_time_mean": 9.824491088278592,
|
| 18 |
+
"execution_time_std": 0.0,
|
| 19 |
+
"num_valid_runs": 1,
|
| 20 |
+
"num_invalid_runs": 0,
|
| 21 |
+
"all_validation_errors": []
|
| 22 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (5.71 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": false,
|
| 3 |
+
"error": "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_1/results/metrics.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": 0.0,
|
| 3 |
+
"correct": false,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": 0.0,
|
| 6 |
+
"execution_time_mean": 0.0,
|
| 7 |
+
"execution_time_std": 0.0,
|
| 8 |
+
"num_successful_runs": 0,
|
| 9 |
+
"num_valid_runs": 0,
|
| 10 |
+
"num_invalid_runs": 0,
|
| 11 |
+
"all_validation_errors": [],
|
| 12 |
+
"correct": false,
|
| 13 |
+
"validation_error": "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
|
| 14 |
+
},
|
| 15 |
+
"auxiliary": {},
|
| 16 |
+
"auxiliary_descriptions": {},
|
| 17 |
+
"timestamp": 1770945966.9155874,
|
| 18 |
+
"generation": 1
|
| 19 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (7.34 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/edit.diff
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
--- a/original.py
|
| 2 |
+
+++ b/original.py
|
| 3 |
+
@@ -1,111 +1,127 @@
|
| 4 |
+
# EVOLVE-BLOCK-START
|
| 5 |
+
"""Initial search baseline for the AlphaEvolve AC inequality task."""
|
| 6 |
+
|
| 7 |
+
import time
|
| 8 |
+
import numpy as np
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def evaluate_sequence(sequence: list[float]) -> float:
|
| 12 |
+
"""
|
| 13 |
+
Evaluate coefficient sequence with safety checks.
|
| 14 |
+
Lower is better.
|
| 15 |
+
"""
|
| 16 |
+
if not isinstance(sequence, list):
|
| 17 |
+
return float(np.inf)
|
| 18 |
+
if not sequence:
|
| 19 |
+
return float(np.inf)
|
| 20 |
+
|
| 21 |
+
clean: list[float] = []
|
| 22 |
+
for x in sequence:
|
| 23 |
+
if isinstance(x, bool) or not isinstance(x, (int, float)):
|
| 24 |
+
return float(np.inf)
|
| 25 |
+
if np.isnan(x) or np.isinf(x):
|
| 26 |
+
return float(np.inf)
|
| 27 |
+
clean.append(float(x))
|
| 28 |
+
|
| 29 |
+
clean = [max(0.0, min(1000.0, x)) for x in clean]
|
| 30 |
+
n = len(clean)
|
| 31 |
+
conv = np.convolve(clean, clean)
|
| 32 |
+
max_b = float(np.max(conv))
|
| 33 |
+
sum_a = float(np.sum(clean))
|
| 34 |
+
if sum_a < 0.01:
|
| 35 |
+
return float(np.inf)
|
| 36 |
+
return float(2.0 * n * max_b / (sum_a**2))
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def _normalize_scale(seq: np.ndarray) -> np.ndarray:
|
| 40 |
+
"""Scale sequence to stable magnitude while keeping nonnegative shape."""
|
| 41 |
+
s = np.asarray(seq, dtype=np.float64)
|
| 42 |
+
s = np.clip(s, 0.0, None)
|
| 43 |
+
total = float(np.sum(s))
|
| 44 |
+
if total <= 1e-12:
|
| 45 |
+
return np.ones_like(s)
|
| 46 |
+
# objective is scale-invariant theoretically, but this keeps numerics stable.
|
| 47 |
+
return s / total * len(s)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 51 |
+
- x = np.linspace(0.0, 1.0, n, endpoint=False)
|
| 52 |
+
- base = (
|
| 53 |
+
- 0.9
|
| 54 |
+
- + 0.30 * np.sin(2.0 * np.pi * x)
|
| 55 |
+
- + 0.12 * np.sin(6.0 * np.pi * x + rng.uniform(0.0, 2.0 * np.pi))
|
| 56 |
+
- )
|
| 57 |
+
- noise = rng.normal(0.0, 0.08, n)
|
| 58 |
+
- return _normalize_scale(base + noise)
|
| 59 |
+
+ """Diverse initializations: sine waves, random, or power laws."""
|
| 60 |
+
+ r = rng.random()
|
| 61 |
+
+ if r < 0.4:
|
| 62 |
+
+ x = np.linspace(0.0, 1.0, n, endpoint=False)
|
| 63 |
+
+ base = 1.0 + 0.4 * np.sin(2.0 * np.pi * x * rng.uniform(1, 3))
|
| 64 |
+
+ elif r < 0.7:
|
| 65 |
+
+ p = rng.uniform(0.3, 0.6)
|
| 66 |
+
+ base = (np.arange(n) + 1.0)**(-p)
|
| 67 |
+
+ else:
|
| 68 |
+
+ p = rng.uniform(0.3, 0.6)
|
| 69 |
+
+ base = (np.arange(n) + 1.0)**(-p) + (n - np.arange(n))**(-p)
|
| 70 |
+
+ base += rng.normal(0, 0.05, n)
|
| 71 |
+
+ return _normalize_scale(base)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 75 |
+
- """
|
| 76 |
+
- Search for a low-value nonnegative sequence.
|
| 77 |
+
-
|
| 78 |
+
- Returns:
|
| 79 |
+
- list[float]: candidate coefficient sequence
|
| 80 |
+
- """
|
| 81 |
+
+ """Search for a low-value nonnegative sequence using gradient and smoothing moves."""
|
| 82 |
+
del kwargs
|
| 83 |
+
-
|
| 84 |
+
rng = np.random.default_rng(seed)
|
| 85 |
+
start = time.time()
|
| 86 |
+
deadline = start + max(0.1, budget_s * 0.98)
|
| 87 |
+
|
| 88 |
+
- # Multi-start initial pool.
|
| 89 |
+
- candidate_lengths = [128, 192, 256, 320, 384]
|
| 90 |
+
- best_seq = _seed_sequence(rng, n=256)
|
| 91 |
+
+ candidate_lengths = [128, 256, 512, 768]
|
| 92 |
+
+ best_seq = _seed_sequence(rng, 256)
|
| 93 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 94 |
+
|
| 95 |
+
for n in candidate_lengths:
|
| 96 |
+
- seq = _seed_sequence(rng, n=n)
|
| 97 |
+
- val = evaluate_sequence(seq.tolist())
|
| 98 |
+
+ for _ in range(2):
|
| 99 |
+
+ seq = _seed_sequence(rng, n)
|
| 100 |
+
+ val = evaluate_sequence(seq.tolist())
|
| 101 |
+
+ if val < best_val:
|
| 102 |
+
+ best_seq, best_val = seq.copy(), val
|
| 103 |
+
+
|
| 104 |
+
+ current_seq = best_seq.copy()
|
| 105 |
+
+ momentum = np.zeros_like(current_seq)
|
| 106 |
+
+
|
| 107 |
+
+ while time.time() < deadline:
|
| 108 |
+
+ n = len(current_seq)
|
| 109 |
+
+ conv = np.convolve(current_seq, current_seq)
|
| 110 |
+
+ p_max = np.max(conv)
|
| 111 |
+
+ sum_a = np.sum(current_seq)
|
| 112 |
+
+
|
| 113 |
+
+ # Gradient targeting peaks to flatten the convolution
|
| 114 |
+
+ peaks = np.where(conv >= 0.995 * p_max)[0]
|
| 115 |
+
+ grad_p = np.zeros(n)
|
| 116 |
+
+ for pk in peaks:
|
| 117 |
+
+ s_j, e_j = max(0, pk - (n - 1)), min(n - 1, pk)
|
| 118 |
+
+ grad_p[s_j : e_j + 1] += current_seq[pk - e_j : pk - s_j + 1][::-1]
|
| 119 |
+
+ grad_p /= len(peaks)
|
| 120 |
+
+
|
| 121 |
+
+ # Combined gradient: dV/da_j proportional to (S * a_rev - P)
|
| 122 |
+
+ grad = (sum_a * grad_p - p_max)
|
| 123 |
+
+ if len(momentum) != n: momentum = np.zeros(n)
|
| 124 |
+
+ momentum = 0.8 * momentum + 0.2 * grad
|
| 125 |
+
+
|
| 126 |
+
+ step_size = 0.002 + 0.01 * rng.random()
|
| 127 |
+
+ current_seq -= step_size * momentum
|
| 128 |
+
+
|
| 129 |
+
+ # Occasional smoothing or upsampling
|
| 130 |
+
+ if rng.random() < 0.1:
|
| 131 |
+
+ current_seq = 0.15 * np.roll(current_seq, 1) + 0.7 * current_seq + 0.15 * np.roll(current_seq, -1)
|
| 132 |
+
+ if rng.random() < 0.05 and n < 800:
|
| 133 |
+
+ current_seq = np.repeat(current_seq, 2)[:800]
|
| 134 |
+
+ momentum = np.zeros(len(current_seq))
|
| 135 |
+
+
|
| 136 |
+
+ current_seq = _normalize_scale(current_seq)
|
| 137 |
+
+ val = evaluate_sequence(current_seq.tolist())
|
| 138 |
+
+
|
| 139 |
+
if val < best_val:
|
| 140 |
+
- best_seq, best_val = seq, val
|
| 141 |
+
-
|
| 142 |
+
- # Local stochastic search: block perturbation + smoothing.
|
| 143 |
+
- while time.time() < deadline:
|
| 144 |
+
- seq = best_seq.copy()
|
| 145 |
+
- n = len(seq)
|
| 146 |
+
-
|
| 147 |
+
- block = int(rng.integers(max(4, n // 64), max(8, n // 10)))
|
| 148 |
+
- idx = rng.choice(n, size=block, replace=False)
|
| 149 |
+
- seq[idx] += rng.normal(0.0, 0.10, size=block)
|
| 150 |
+
-
|
| 151 |
+
- if rng.random() < 0.35:
|
| 152 |
+
- # low-pass smooth
|
| 153 |
+
- seq = (
|
| 154 |
+
- 0.25 * np.roll(seq, 1)
|
| 155 |
+
- + 0.50 * seq
|
| 156 |
+
- + 0.25 * np.roll(seq, -1)
|
| 157 |
+
- )
|
| 158 |
+
-
|
| 159 |
+
- if rng.random() < 0.15 and n < 800:
|
| 160 |
+
- # upsample once in a while to explore larger dimensions
|
| 161 |
+
- seq = np.repeat(seq, 2)[: min(800, 2 * n)]
|
| 162 |
+
-
|
| 163 |
+
- seq = _normalize_scale(seq)
|
| 164 |
+
- val = evaluate_sequence(seq.tolist())
|
| 165 |
+
- if val < best_val:
|
| 166 |
+
- best_seq, best_val = seq, val
|
| 167 |
+
+ best_seq, best_val = current_seq.copy(), val
|
| 168 |
+
+ elif rng.random() < 0.1: # Explore
|
| 169 |
+
+ pass
|
| 170 |
+
+ else: # Greedy descent
|
| 171 |
+
+ current_seq = best_seq.copy()
|
| 172 |
+
+ momentum *= 0.5
|
| 173 |
+
|
| 174 |
+
return [float(x) for x in best_seq.tolist()]
|
| 175 |
+
|
| 176 |
+
|
| 177 |
+
# EVOLVE-BLOCK-END
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/main.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVOLVE-BLOCK-START
|
| 2 |
+
"""Initial search baseline for the AlphaEvolve AC inequality task."""
|
| 3 |
+
|
| 4 |
+
import time
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def evaluate_sequence(sequence: list[float]) -> float:
|
| 9 |
+
"""
|
| 10 |
+
Evaluate coefficient sequence with safety checks.
|
| 11 |
+
Lower is better.
|
| 12 |
+
"""
|
| 13 |
+
if not isinstance(sequence, list):
|
| 14 |
+
return float(np.inf)
|
| 15 |
+
if not sequence:
|
| 16 |
+
return float(np.inf)
|
| 17 |
+
|
| 18 |
+
clean: list[float] = []
|
| 19 |
+
for x in sequence:
|
| 20 |
+
if isinstance(x, bool) or not isinstance(x, (int, float)):
|
| 21 |
+
return float(np.inf)
|
| 22 |
+
if np.isnan(x) or np.isinf(x):
|
| 23 |
+
return float(np.inf)
|
| 24 |
+
clean.append(float(x))
|
| 25 |
+
|
| 26 |
+
clean = [max(0.0, min(1000.0, x)) for x in clean]
|
| 27 |
+
n = len(clean)
|
| 28 |
+
conv = np.convolve(clean, clean)
|
| 29 |
+
max_b = float(np.max(conv))
|
| 30 |
+
sum_a = float(np.sum(clean))
|
| 31 |
+
if sum_a < 0.01:
|
| 32 |
+
return float(np.inf)
|
| 33 |
+
return float(2.0 * n * max_b / (sum_a**2))
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def _normalize_scale(seq: np.ndarray) -> np.ndarray:
|
| 37 |
+
"""Scale sequence to stable magnitude while keeping nonnegative shape."""
|
| 38 |
+
s = np.asarray(seq, dtype=np.float64)
|
| 39 |
+
s = np.clip(s, 0.0, None)
|
| 40 |
+
total = float(np.sum(s))
|
| 41 |
+
if total <= 1e-12:
|
| 42 |
+
return np.ones_like(s)
|
| 43 |
+
# objective is scale-invariant theoretically, but this keeps numerics stable.
|
| 44 |
+
return s / total * len(s)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 48 |
+
"""Diverse initializations: sine waves, random, or power laws."""
|
| 49 |
+
r = rng.random()
|
| 50 |
+
if r < 0.4:
|
| 51 |
+
x = np.linspace(0.0, 1.0, n, endpoint=False)
|
| 52 |
+
base = 1.0 + 0.4 * np.sin(2.0 * np.pi * x * rng.uniform(1, 3))
|
| 53 |
+
elif r < 0.7:
|
| 54 |
+
p = rng.uniform(0.3, 0.6)
|
| 55 |
+
base = (np.arange(n) + 1.0)**(-p)
|
| 56 |
+
else:
|
| 57 |
+
p = rng.uniform(0.3, 0.6)
|
| 58 |
+
base = (np.arange(n) + 1.0)**(-p) + (n - np.arange(n))**(-p)
|
| 59 |
+
base += rng.normal(0, 0.05, n)
|
| 60 |
+
return _normalize_scale(base)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 64 |
+
"""Search for a low-value nonnegative sequence using gradient and smoothing moves."""
|
| 65 |
+
del kwargs
|
| 66 |
+
rng = np.random.default_rng(seed)
|
| 67 |
+
start = time.time()
|
| 68 |
+
deadline = start + max(0.1, budget_s * 0.98)
|
| 69 |
+
|
| 70 |
+
candidate_lengths = [128, 256, 512, 768]
|
| 71 |
+
best_seq = _seed_sequence(rng, 256)
|
| 72 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 73 |
+
|
| 74 |
+
for n in candidate_lengths:
|
| 75 |
+
for _ in range(2):
|
| 76 |
+
seq = _seed_sequence(rng, n)
|
| 77 |
+
val = evaluate_sequence(seq.tolist())
|
| 78 |
+
if val < best_val:
|
| 79 |
+
best_seq, best_val = seq.copy(), val
|
| 80 |
+
|
| 81 |
+
current_seq = best_seq.copy()
|
| 82 |
+
momentum = np.zeros_like(current_seq)
|
| 83 |
+
|
| 84 |
+
while time.time() < deadline:
|
| 85 |
+
n = len(current_seq)
|
| 86 |
+
conv = np.convolve(current_seq, current_seq)
|
| 87 |
+
p_max = np.max(conv)
|
| 88 |
+
sum_a = np.sum(current_seq)
|
| 89 |
+
|
| 90 |
+
# Gradient targeting peaks to flatten the convolution
|
| 91 |
+
peaks = np.where(conv >= 0.995 * p_max)[0]
|
| 92 |
+
grad_p = np.zeros(n)
|
| 93 |
+
for pk in peaks:
|
| 94 |
+
s_j, e_j = max(0, pk - (n - 1)), min(n - 1, pk)
|
| 95 |
+
grad_p[s_j : e_j + 1] += current_seq[pk - e_j : pk - s_j + 1][::-1]
|
| 96 |
+
grad_p /= len(peaks)
|
| 97 |
+
|
| 98 |
+
# Combined gradient: dV/da_j proportional to (S * a_rev - P)
|
| 99 |
+
grad = (sum_a * grad_p - p_max)
|
| 100 |
+
if len(momentum) != n: momentum = np.zeros(n)
|
| 101 |
+
momentum = 0.8 * momentum + 0.2 * grad
|
| 102 |
+
|
| 103 |
+
step_size = 0.002 + 0.01 * rng.random()
|
| 104 |
+
current_seq -= step_size * momentum
|
| 105 |
+
|
| 106 |
+
# Occasional smoothing or upsampling
|
| 107 |
+
if rng.random() < 0.1:
|
| 108 |
+
current_seq = 0.15 * np.roll(current_seq, 1) + 0.7 * current_seq + 0.15 * np.roll(current_seq, -1)
|
| 109 |
+
if rng.random() < 0.05 and n < 800:
|
| 110 |
+
current_seq = np.repeat(current_seq, 2)[:800]
|
| 111 |
+
momentum = np.zeros(len(current_seq))
|
| 112 |
+
|
| 113 |
+
current_seq = _normalize_scale(current_seq)
|
| 114 |
+
val = evaluate_sequence(current_seq.tolist())
|
| 115 |
+
|
| 116 |
+
if val < best_val:
|
| 117 |
+
best_seq, best_val = current_seq.copy(), val
|
| 118 |
+
elif rng.random() < 0.1: # Explore
|
| 119 |
+
pass
|
| 120 |
+
else: # Greedy descent
|
| 121 |
+
current_seq = best_seq.copy()
|
| 122 |
+
momentum *= 0.5
|
| 123 |
+
|
| 124 |
+
return [float(x) for x in best_seq.tolist()]
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
# EVOLVE-BLOCK-END
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/original.py
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVOLVE-BLOCK-START
|
| 2 |
+
"""Initial search baseline for the AlphaEvolve AC inequality task."""
|
| 3 |
+
|
| 4 |
+
import time
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def evaluate_sequence(sequence: list[float]) -> float:
|
| 9 |
+
"""
|
| 10 |
+
Evaluate coefficient sequence with safety checks.
|
| 11 |
+
Lower is better.
|
| 12 |
+
"""
|
| 13 |
+
if not isinstance(sequence, list):
|
| 14 |
+
return float(np.inf)
|
| 15 |
+
if not sequence:
|
| 16 |
+
return float(np.inf)
|
| 17 |
+
|
| 18 |
+
clean: list[float] = []
|
| 19 |
+
for x in sequence:
|
| 20 |
+
if isinstance(x, bool) or not isinstance(x, (int, float)):
|
| 21 |
+
return float(np.inf)
|
| 22 |
+
if np.isnan(x) or np.isinf(x):
|
| 23 |
+
return float(np.inf)
|
| 24 |
+
clean.append(float(x))
|
| 25 |
+
|
| 26 |
+
clean = [max(0.0, min(1000.0, x)) for x in clean]
|
| 27 |
+
n = len(clean)
|
| 28 |
+
conv = np.convolve(clean, clean)
|
| 29 |
+
max_b = float(np.max(conv))
|
| 30 |
+
sum_a = float(np.sum(clean))
|
| 31 |
+
if sum_a < 0.01:
|
| 32 |
+
return float(np.inf)
|
| 33 |
+
return float(2.0 * n * max_b / (sum_a**2))
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def _normalize_scale(seq: np.ndarray) -> np.ndarray:
|
| 37 |
+
"""Scale sequence to stable magnitude while keeping nonnegative shape."""
|
| 38 |
+
s = np.asarray(seq, dtype=np.float64)
|
| 39 |
+
s = np.clip(s, 0.0, None)
|
| 40 |
+
total = float(np.sum(s))
|
| 41 |
+
if total <= 1e-12:
|
| 42 |
+
return np.ones_like(s)
|
| 43 |
+
# objective is scale-invariant theoretically, but this keeps numerics stable.
|
| 44 |
+
return s / total * len(s)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 48 |
+
x = np.linspace(0.0, 1.0, n, endpoint=False)
|
| 49 |
+
base = (
|
| 50 |
+
0.9
|
| 51 |
+
+ 0.30 * np.sin(2.0 * np.pi * x)
|
| 52 |
+
+ 0.12 * np.sin(6.0 * np.pi * x + rng.uniform(0.0, 2.0 * np.pi))
|
| 53 |
+
)
|
| 54 |
+
noise = rng.normal(0.0, 0.08, n)
|
| 55 |
+
return _normalize_scale(base + noise)
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 59 |
+
"""
|
| 60 |
+
Search for a low-value nonnegative sequence.
|
| 61 |
+
|
| 62 |
+
Returns:
|
| 63 |
+
list[float]: candidate coefficient sequence
|
| 64 |
+
"""
|
| 65 |
+
del kwargs
|
| 66 |
+
|
| 67 |
+
rng = np.random.default_rng(seed)
|
| 68 |
+
start = time.time()
|
| 69 |
+
deadline = start + max(0.1, budget_s * 0.98)
|
| 70 |
+
|
| 71 |
+
# Multi-start initial pool.
|
| 72 |
+
candidate_lengths = [128, 192, 256, 320, 384]
|
| 73 |
+
best_seq = _seed_sequence(rng, n=256)
|
| 74 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 75 |
+
|
| 76 |
+
for n in candidate_lengths:
|
| 77 |
+
seq = _seed_sequence(rng, n=n)
|
| 78 |
+
val = evaluate_sequence(seq.tolist())
|
| 79 |
+
if val < best_val:
|
| 80 |
+
best_seq, best_val = seq, val
|
| 81 |
+
|
| 82 |
+
# Local stochastic search: block perturbation + smoothing.
|
| 83 |
+
while time.time() < deadline:
|
| 84 |
+
seq = best_seq.copy()
|
| 85 |
+
n = len(seq)
|
| 86 |
+
|
| 87 |
+
block = int(rng.integers(max(4, n // 64), max(8, n // 10)))
|
| 88 |
+
idx = rng.choice(n, size=block, replace=False)
|
| 89 |
+
seq[idx] += rng.normal(0.0, 0.10, size=block)
|
| 90 |
+
|
| 91 |
+
if rng.random() < 0.35:
|
| 92 |
+
# low-pass smooth
|
| 93 |
+
seq = (
|
| 94 |
+
0.25 * np.roll(seq, 1)
|
| 95 |
+
+ 0.50 * seq
|
| 96 |
+
+ 0.25 * np.roll(seq, -1)
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
if rng.random() < 0.15 and n < 800:
|
| 100 |
+
# upsample once in a while to explore larger dimensions
|
| 101 |
+
seq = np.repeat(seq, 2)[: min(800, 2 * n)]
|
| 102 |
+
|
| 103 |
+
seq = _normalize_scale(seq)
|
| 104 |
+
val = evaluate_sequence(seq.tolist())
|
| 105 |
+
if val < best_val:
|
| 106 |
+
best_seq, best_val = seq, val
|
| 107 |
+
|
| 108 |
+
return [float(x) for x in best_seq.tolist()]
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
# EVOLVE-BLOCK-END
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": true,
|
| 3 |
+
"error": null
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/results/metrics.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": -1.7332795776418672,
|
| 3 |
+
"correct": true,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": -1.7332795776418672,
|
| 6 |
+
"public": {
|
| 7 |
+
"best_value": 1.7332795776418672,
|
| 8 |
+
"best_length": 800,
|
| 9 |
+
"num_runs": 1
|
| 10 |
+
},
|
| 11 |
+
"private": {
|
| 12 |
+
"all_values": [
|
| 13 |
+
1.7332795776418672
|
| 14 |
+
],
|
| 15 |
+
"all_lengths": [
|
| 16 |
+
800
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"text_feedback": "Lower evaluate_sequence value is better. combined_score = -best_value.",
|
| 20 |
+
"execution_time_mean": 9.828074638731778,
|
| 21 |
+
"execution_time_std": 0.0,
|
| 22 |
+
"num_valid_runs": 1,
|
| 23 |
+
"num_invalid_runs": 0,
|
| 24 |
+
"all_validation_errors": [],
|
| 25 |
+
"correct": true,
|
| 26 |
+
"validation_error": null
|
| 27 |
+
},
|
| 28 |
+
"auxiliary": {},
|
| 29 |
+
"auxiliary_descriptions": {},
|
| 30 |
+
"timestamp": 1770947329.8182533,
|
| 31 |
+
"generation": 10
|
| 32 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_10/search_replace.txt
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<NAME>
|
| 2 |
+
gradient_guided_search
|
| 3 |
+
</NAME>
|
| 4 |
+
|
| 5 |
+
<DESCRIPTION>
|
| 6 |
+
Optimized the search by focusing on a gradient-guided approach to flatten the self-convolution of the sequence.
|
| 7 |
+
1. Re-introduced a refined gradient calculation that targets the peaks of the convolution, which are the main bottlenecks for the evaluator.
|
| 8 |
+
2. Improved initialization with a more diverse set of starting shapes (power-law, U-shape, sine waves).
|
| 9 |
+
3. Used a more aggressive gradient descent loop with momentum to efficiently minimize the objective.
|
| 10 |
+
4. Simplified the normalization step for numerical stability.
|
| 11 |
+
5. The gradient move $a_i \leftarrow a_i - \eta (S a_{k-i} - P)$ directly reduces the maximum of the convolution while maintaining the sum of the sequence.
|
| 12 |
+
6. Multi-start exploration combined with focused local search ensures better coverage of the search space.
|
| 13 |
+
</DESCRIPTION>
|
| 14 |
+
|
| 15 |
+
<DIFF>
|
| 16 |
+
<<<<<<< SEARCH
|
| 17 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 18 |
+
x = np.linspace(0.0, 1.0, n, endpoint=False)
|
| 19 |
+
base = (
|
| 20 |
+
0.9
|
| 21 |
+
+ 0.30 * np.sin(2.0 * np.pi * x)
|
| 22 |
+
+ 0.12 * np.sin(6.0 * np.pi * x + rng.uniform(0.0, 2.0 * np.pi))
|
| 23 |
+
)
|
| 24 |
+
noise = rng.normal(0.0, 0.08, n)
|
| 25 |
+
return _normalize_scale(base + noise)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 29 |
+
"""
|
| 30 |
+
Search for a low-value nonnegative sequence.
|
| 31 |
+
|
| 32 |
+
Returns:
|
| 33 |
+
list[float]: candidate coefficient sequence
|
| 34 |
+
"""
|
| 35 |
+
del kwargs
|
| 36 |
+
|
| 37 |
+
rng = np.random.default_rng(seed)
|
| 38 |
+
start = time.time()
|
| 39 |
+
deadline = start + max(0.1, budget_s * 0.98)
|
| 40 |
+
|
| 41 |
+
# Multi-start initial pool.
|
| 42 |
+
candidate_lengths = [128, 192, 256, 320, 384]
|
| 43 |
+
best_seq = _seed_sequence(rng, n=256)
|
| 44 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 45 |
+
|
| 46 |
+
for n in candidate_lengths:
|
| 47 |
+
seq = _seed_sequence(rng, n=n)
|
| 48 |
+
val = evaluate_sequence(seq.tolist())
|
| 49 |
+
if val < best_val:
|
| 50 |
+
best_seq, best_val = seq, val
|
| 51 |
+
|
| 52 |
+
# Local stochastic search: block perturbation + smoothing.
|
| 53 |
+
while time.time() < deadline:
|
| 54 |
+
seq = best_seq.copy()
|
| 55 |
+
n = len(seq)
|
| 56 |
+
|
| 57 |
+
block = int(rng.integers(max(4, n // 64), max(8, n // 10)))
|
| 58 |
+
idx = rng.choice(n, size=block, replace=False)
|
| 59 |
+
seq[idx] += rng.normal(0.0, 0.10, size=block)
|
| 60 |
+
|
| 61 |
+
if rng.random() < 0.35:
|
| 62 |
+
# low-pass smooth
|
| 63 |
+
seq = (
|
| 64 |
+
0.25 * np.roll(seq, 1)
|
| 65 |
+
+ 0.50 * seq
|
| 66 |
+
+ 0.25 * np.roll(seq, -1)
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
if rng.random() < 0.15 and n < 800:
|
| 70 |
+
# upsample once in a while to explore larger dimensions
|
| 71 |
+
seq = np.repeat(seq, 2)[: min(800, 2 * n)]
|
| 72 |
+
|
| 73 |
+
seq = _normalize_scale(seq)
|
| 74 |
+
val = evaluate_sequence(seq.tolist())
|
| 75 |
+
if val < best_val:
|
| 76 |
+
best_seq, best_val = seq, val
|
| 77 |
+
|
| 78 |
+
return [float(x) for x in best_seq.tolist()]
|
| 79 |
+
=======
|
| 80 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 81 |
+
"""Diverse initializations: sine waves, random, or power laws."""
|
| 82 |
+
r = rng.random()
|
| 83 |
+
if r < 0.4:
|
| 84 |
+
x = np.linspace(0.0, 1.0, n, endpoint=False)
|
| 85 |
+
base = 1.0 + 0.4 * np.sin(2.0 * np.pi * x * rng.uniform(1, 3))
|
| 86 |
+
elif r < 0.7:
|
| 87 |
+
p = rng.uniform(0.3, 0.6)
|
| 88 |
+
base = (np.arange(n) + 1.0)**(-p)
|
| 89 |
+
else:
|
| 90 |
+
p = rng.uniform(0.3, 0.6)
|
| 91 |
+
base = (np.arange(n) + 1.0)**(-p) + (n - np.arange(n))**(-p)
|
| 92 |
+
base += rng.normal(0, 0.05, n)
|
| 93 |
+
return _normalize_scale(base)
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 97 |
+
"""Search for a low-value nonnegative sequence using gradient and smoothing moves."""
|
| 98 |
+
del kwargs
|
| 99 |
+
rng = np.random.default_rng(seed)
|
| 100 |
+
start = time.time()
|
| 101 |
+
deadline = start + max(0.1, budget_s * 0.98)
|
| 102 |
+
|
| 103 |
+
candidate_lengths = [128, 256, 512, 768]
|
| 104 |
+
best_seq = _seed_sequence(rng, 256)
|
| 105 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 106 |
+
|
| 107 |
+
for n in candidate_lengths:
|
| 108 |
+
for _ in range(2):
|
| 109 |
+
seq = _seed_sequence(rng, n)
|
| 110 |
+
val = evaluate_sequence(seq.tolist())
|
| 111 |
+
if val < best_val:
|
| 112 |
+
best_seq, best_val = seq.copy(), val
|
| 113 |
+
|
| 114 |
+
current_seq = best_seq.copy()
|
| 115 |
+
momentum = np.zeros_like(current_seq)
|
| 116 |
+
|
| 117 |
+
while time.time() < deadline:
|
| 118 |
+
n = len(current_seq)
|
| 119 |
+
conv = np.convolve(current_seq, current_seq)
|
| 120 |
+
p_max = np.max(conv)
|
| 121 |
+
sum_a = np.sum(current_seq)
|
| 122 |
+
|
| 123 |
+
# Gradient targeting peaks to flatten the convolution
|
| 124 |
+
peaks = np.where(conv >= 0.995 * p_max)[0]
|
| 125 |
+
grad_p = np.zeros(n)
|
| 126 |
+
for pk in peaks:
|
| 127 |
+
s_j, e_j = max(0, pk - (n - 1)), min(n - 1, pk)
|
| 128 |
+
grad_p[s_j : e_j + 1] += current_seq[pk - e_j : pk - s_j + 1][::-1]
|
| 129 |
+
grad_p /= len(peaks)
|
| 130 |
+
|
| 131 |
+
# Combined gradient: dV/da_j proportional to (S * a_rev - P)
|
| 132 |
+
grad = (sum_a * grad_p - p_max)
|
| 133 |
+
if len(momentum) != n: momentum = np.zeros(n)
|
| 134 |
+
momentum = 0.8 * momentum + 0.2 * grad
|
| 135 |
+
|
| 136 |
+
step_size = 0.002 + 0.01 * rng.random()
|
| 137 |
+
current_seq -= step_size * momentum
|
| 138 |
+
|
| 139 |
+
# Occasional smoothing or upsampling
|
| 140 |
+
if rng.random() < 0.1:
|
| 141 |
+
current_seq = 0.15 * np.roll(current_seq, 1) + 0.7 * current_seq + 0.15 * np.roll(current_seq, -1)
|
| 142 |
+
if rng.random() < 0.05 and n < 800:
|
| 143 |
+
current_seq = np.repeat(current_seq, 2)[:800]
|
| 144 |
+
momentum = np.zeros(len(current_seq))
|
| 145 |
+
|
| 146 |
+
current_seq = _normalize_scale(current_seq)
|
| 147 |
+
val = evaluate_sequence(current_seq.tolist())
|
| 148 |
+
|
| 149 |
+
if val < best_val:
|
| 150 |
+
best_seq, best_val = current_seq.copy(), val
|
| 151 |
+
elif rng.random() < 0.1: # Explore
|
| 152 |
+
pass
|
| 153 |
+
else: # Greedy descent
|
| 154 |
+
current_seq = best_seq.copy()
|
| 155 |
+
momentum *= 0.5
|
| 156 |
+
|
| 157 |
+
return [float(x) for x in best_seq.tolist()]
|
| 158 |
+
>>>>>>> REPLACE
|
| 159 |
+
</DIFF>
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (10.8 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": true,
|
| 3 |
+
"error": null
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_100/results/metrics.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": -1.6159124140034282,
|
| 3 |
+
"correct": true,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": -1.6159124140034282,
|
| 6 |
+
"public": {
|
| 7 |
+
"best_value": 1.6159124140034282,
|
| 8 |
+
"best_length": 768,
|
| 9 |
+
"num_runs": 1
|
| 10 |
+
},
|
| 11 |
+
"private": {
|
| 12 |
+
"all_values": [
|
| 13 |
+
1.6159124140034282
|
| 14 |
+
],
|
| 15 |
+
"all_lengths": [
|
| 16 |
+
768
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"text_feedback": "Lower evaluate_sequence value is better. combined_score = -best_value.",
|
| 20 |
+
"execution_time_mean": 9.624990861862898,
|
| 21 |
+
"execution_time_std": 0.0,
|
| 22 |
+
"num_valid_runs": 1,
|
| 23 |
+
"num_invalid_runs": 0,
|
| 24 |
+
"all_validation_errors": [],
|
| 25 |
+
"correct": true,
|
| 26 |
+
"validation_error": null
|
| 27 |
+
},
|
| 28 |
+
"auxiliary": {},
|
| 29 |
+
"auxiliary_descriptions": {},
|
| 30 |
+
"timestamp": 1770954621.617363,
|
| 31 |
+
"generation": 100
|
| 32 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (10.4 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": true,
|
| 3 |
+
"error": null
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_101/results/metrics.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": -1.706869938583198,
|
| 3 |
+
"correct": true,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": -1.706869938583198,
|
| 6 |
+
"public": {
|
| 7 |
+
"best_value": 1.706869938583198,
|
| 8 |
+
"best_length": 768,
|
| 9 |
+
"num_runs": 1
|
| 10 |
+
},
|
| 11 |
+
"private": {
|
| 12 |
+
"all_values": [
|
| 13 |
+
1.706869938583198
|
| 14 |
+
],
|
| 15 |
+
"all_lengths": [
|
| 16 |
+
768
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"text_feedback": "Lower evaluate_sequence value is better. combined_score = -best_value.",
|
| 20 |
+
"execution_time_mean": 9.829864730127156,
|
| 21 |
+
"execution_time_std": 0.0,
|
| 22 |
+
"num_valid_runs": 1,
|
| 23 |
+
"num_invalid_runs": 0,
|
| 24 |
+
"all_validation_errors": [],
|
| 25 |
+
"correct": true,
|
| 26 |
+
"validation_error": null
|
| 27 |
+
},
|
| 28 |
+
"auxiliary": {},
|
| 29 |
+
"auxiliary_descriptions": {},
|
| 30 |
+
"timestamp": 1770954700.8218436,
|
| 31 |
+
"generation": 101
|
| 32 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (9.47 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/edit.diff
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
--- a/original.py
|
| 2 |
+
+++ b/original.py
|
| 3 |
+
@@ -1,182 +1,169 @@
|
| 4 |
+
# EVOLVE-BLOCK-START
|
| 5 |
+
-"""Initial search baseline for the AlphaEvolve AC inequality task."""
|
| 6 |
+
-
|
| 7 |
+
-import time
|
| 8 |
+
-import numpy as np
|
| 9 |
+
-
|
| 10 |
+
+"""
|
| 11 |
+
+Surgical gradient refinement for the AlphaEvolve AC inequality task.
|
| 12 |
+
+Optimizes a non-negative sequence to minimize 2*n*max(convolve(a,a)) / (sum(a)^2).
|
| 13 |
+
+"""
|
| 14 |
+
|
| 15 |
+
def evaluate_sequence(sequence: list[float]) -> float:
|
| 16 |
+
"""
|
| 17 |
+
Evaluate coefficient sequence with safety checks.
|
| 18 |
+
Lower is better.
|
| 19 |
+
"""
|
| 20 |
+
- if not isinstance(sequence, list):
|
| 21 |
+
- return float(np.inf)
|
| 22 |
+
- if not sequence:
|
| 23 |
+
+ if not isinstance(sequence, list) or not sequence:
|
| 24 |
+
return float(np.inf)
|
| 25 |
+
|
| 26 |
+
clean: list[float] = []
|
| 27 |
+
for x in sequence:
|
| 28 |
+
if isinstance(x, bool) or not isinstance(x, (int, float)):
|
| 29 |
+
return float(np.inf)
|
| 30 |
+
if np.isnan(x) or np.isinf(x):
|
| 31 |
+
return float(np.inf)
|
| 32 |
+
clean.append(float(x))
|
| 33 |
+
|
| 34 |
+
clean = [max(0.0, min(1000.0, x)) for x in clean]
|
| 35 |
+
n = len(clean)
|
| 36 |
+
conv = np.convolve(clean, clean)
|
| 37 |
+
max_b = float(np.max(conv))
|
| 38 |
+
sum_a = float(np.sum(clean))
|
| 39 |
+
- if sum_a < 0.01:
|
| 40 |
+
+ if sum_a < 1e-6:
|
| 41 |
+
return float(np.inf)
|
| 42 |
+
return float(2.0 * n * max_b / (sum_a**2))
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def _normalize_scale(seq: np.ndarray) -> np.ndarray:
|
| 46 |
+
- """Scale sequence to sum to n while maintaining nonnegativity."""
|
| 47 |
+
- s = np.clip(np.asarray(seq, dtype=np.float64), 0.0, None)
|
| 48 |
+
+ """Scale sequence to sum to its length while maintaining nonnegativity."""
|
| 49 |
+
+ s = np.clip(np.asarray(seq, dtype=np.float64), 0.0, 1000.0)
|
| 50 |
+
total = np.sum(s)
|
| 51 |
+
if total <= 1e-12:
|
| 52 |
+
return np.ones_like(s)
|
| 53 |
+
return s * (len(s) / total)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 57 |
+
- """Diverse seeds focusing on power laws and structured hills."""
|
| 58 |
+
+ """Seeds focusing on power-laws and symmetric hills."""
|
| 59 |
+
x = np.linspace(0.0, 1.0, n, endpoint=True)
|
| 60 |
+
mode = rng.integers(0, 6)
|
| 61 |
+
if mode == 0:
|
| 62 |
+
base = np.ones(n)
|
| 63 |
+
- elif mode == 1: # Symmetric Power Law (Promising structure for AC inequality)
|
| 64 |
+
- p = rng.uniform(0.42, 0.58)
|
| 65 |
+
+ elif mode == 1: # Symmetric Power Law (Ideal structure for this task)
|
| 66 |
+
+ p = rng.uniform(0.45, 0.55)
|
| 67 |
+
base = (np.arange(n) + 1.0)**(-p) + (n - np.arange(n))**(-p)
|
| 68 |
+
- elif mode == 2: # Asymmetric Power Law
|
| 69 |
+
- p = rng.uniform(0.42, 0.58)
|
| 70 |
+
+ elif mode == 2: # Root-sine hill
|
| 71 |
+
+ base = np.sqrt(np.sin(np.pi * x) + 0.1)
|
| 72 |
+
+ elif mode == 3: # Asymmetric Power Law
|
| 73 |
+
+ p = rng.uniform(0.45, 0.55)
|
| 74 |
+
base = (np.arange(n) + 1.0)**(-p)
|
| 75 |
+
- elif mode == 3: # Sine Hill
|
| 76 |
+
- base = 1.0 + 0.6 * np.sin(np.pi * x)
|
| 77 |
+
elif mode == 4: # Gaussian
|
| 78 |
+
- base = np.exp(-0.5 * ((x - 0.5) / 0.18)**2)
|
| 79 |
+
- else: # Quadratic Bowl
|
| 80 |
+
- base = 1.0 + 0.6 * (x - 0.5)**2
|
| 81 |
+
+ base = np.exp(-0.5 * ((x - 0.5) / 0.2)**2)
|
| 82 |
+
+ else: # Symmetric 'Bowl'
|
| 83 |
+
+ base = 1.0 + 0.5 * (x - 0.5)**2
|
| 84 |
+
|
| 85 |
+
- if rng.random() < 0.3:
|
| 86 |
+
- base += 0.1 * rng.normal(0, 1, n)
|
| 87 |
+
-
|
| 88 |
+
- seq = base + rng.normal(0.0, 0.02, n)
|
| 89 |
+
- if rng.random() < 0.5:
|
| 90 |
+
+ noise = rng.normal(0.0, 0.02, n)
|
| 91 |
+
+ seq = base + noise
|
| 92 |
+
+ if rng.random() < 0.7:
|
| 93 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 94 |
+
return _normalize_scale(seq)
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 98 |
+
- """Search for a low-value nonnegative sequence using a sensitivity-based gradient and targeted moves."""
|
| 99 |
+
- del kwargs
|
| 100 |
+
+ """Search for optimal sequence using exponentiated gradient moves and resolution scaling."""
|
| 101 |
+
rng = np.random.default_rng(seed)
|
| 102 |
+
start_time = time.time()
|
| 103 |
+
deadline = start_time + max(0.1, budget_s * 0.98)
|
| 104 |
+
|
| 105 |
+
+ # Initial seeding phase at low resolution
|
| 106 |
+
best_seq = _normalize_scale(np.ones(128))
|
| 107 |
+
- best_val = 2.0 * np.max(np.convolve(best_seq, best_seq)) / best_seq.size
|
| 108 |
+
+ best_val = evaluate_sequence(best_seq.tolist())
|
| 109 |
+
|
| 110 |
+
- # Seeding
|
| 111 |
+
- for n_init in [128, 256, 512]:
|
| 112 |
+
+ for n_init in [128, 256, 384]:
|
| 113 |
+
for _ in range(8):
|
| 114 |
+
seq = _seed_sequence(rng, n_init)
|
| 115 |
+
- v = 2.0 * np.max(np.convolve(seq, seq)) / seq.size
|
| 116 |
+
- if v < best_val:
|
| 117 |
+
- best_seq, best_val = seq, v
|
| 118 |
+
+ val = evaluate_sequence(seq.tolist())
|
| 119 |
+
+ if val < best_val:
|
| 120 |
+
+ best_seq, best_val = seq, val
|
| 121 |
+
|
| 122 |
+
+ # Multi-resolution optimization
|
| 123 |
+
resolutions = [128, 256, 512, 768]
|
| 124 |
+
- time_shares = [0.08, 0.20, 0.45, 1.0]
|
| 125 |
+
+ time_shares = [0.06, 0.18, 0.42, 1.0] # Skew time heavily toward final res
|
| 126 |
+
+
|
| 127 |
+
for idx, target_n in enumerate(resolutions):
|
| 128 |
+
- if target_n > best_seq.size:
|
| 129 |
+
+ if target_n != best_seq.size:
|
| 130 |
+
best_seq = np.interp(np.linspace(0, 1, target_n), np.linspace(0, 1, best_seq.size), best_seq)
|
| 131 |
+
best_seq = _normalize_scale(best_seq)
|
| 132 |
+
- best_val = 2.0 * np.max(np.convolve(best_seq, best_seq)) / best_seq.size
|
| 133 |
+
+ best_val = evaluate_sequence(best_seq.tolist())
|
| 134 |
+
|
| 135 |
+
res_deadline = start_time + time_shares[idx] * (deadline - start_time)
|
| 136 |
+
while time.time() < res_deadline:
|
| 137 |
+
progress = (time.time() - start_time) / (deadline - start_time + 1e-9)
|
| 138 |
+
- sigma = 0.15 * (1.0 - progress)**1.1
|
| 139 |
+
+ # sigma decays as refinement progresses
|
| 140 |
+
+ sigma = 0.20 * (1.0 - progress)**1.1
|
| 141 |
+
seq = best_seq.copy()
|
| 142 |
+
n = seq.size
|
| 143 |
+
was_symmetric = np.allclose(seq, seq[::-1], atol=1e-8)
|
| 144 |
+
+
|
| 145 |
+
m_type = rng.random()
|
| 146 |
+
-
|
| 147 |
+
- if m_type < 0.08: # Block perturbation
|
| 148 |
+
+ if m_type < 0.85: # Surgical Exponentiated Gradient Move
|
| 149 |
+
+ c = np.convolve(seq, seq)
|
| 150 |
+
+ max_c = np.max(c)
|
| 151 |
+
+ sum_a = np.sum(seq)
|
| 152 |
+
+
|
| 153 |
+
+ # Sharpen peak focus over time
|
| 154 |
+
+ beta = 50.0 + 450.0 * (progress**1.2)
|
| 155 |
+
+ # Compute softmax weights of the convolution peaks
|
| 156 |
+
+ # Subtracting max(beta*(...)) for numerical stability
|
| 157 |
+
+ w = np.exp(beta * (c / (max_c + 1e-12) - 1.0))
|
| 158 |
+
+ w /= (np.sum(w) + 1e-15)
|
| 159 |
+
+
|
| 160 |
+
+ # Gradient of sum(w*C) with respect to sequence 'a'
|
| 161 |
+
+ grad = np.convolve(w, seq[::-1], mode='valid')
|
| 162 |
+
+
|
| 163 |
+
+ # rel_grad_log is the gradient of the log-objective with respect to log(a_i)
|
| 164 |
+
+ # d log(max_c)/d log(a_i) = (a_i/max_c) * (2*grad_i)
|
| 165 |
+
+ # d log(sum_a^2)/d log(a_i) = (a_i/(sum_a^2)) * (2*sum_a) = 2*a_i/sum_a
|
| 166 |
+
+ rel_grad_log = (grad * seq / (max_c + 1e-12)) - (seq / (sum_a + 1e-12))
|
| 167 |
+
+
|
| 168 |
+
+ # Exponentiated gradient step
|
| 169 |
+
+ step_size = 0.8 * sigma
|
| 170 |
+
+ seq *= np.exp(-step_size * rel_grad_log * n)
|
| 171 |
+
+
|
| 172 |
+
+ elif m_type < 0.92: # Spectral Smoothing and Low-Frequency Jitter
|
| 173 |
+
+ f = np.fft.rfft(seq)
|
| 174 |
+
+ # Suppress high-frequency noise that doesn't help flatten convolution
|
| 175 |
+
+ cutoff = max(1, int(len(f) * (0.15 + 0.1 * (1.0 - progress))))
|
| 176 |
+
+ f[cutoff:] *= (1.0 - 0.5 * sigma)
|
| 177 |
+
+ # Small low-frequency perturbation for global shape exploration
|
| 178 |
+
+ low_idx = rng.integers(1, cutoff, size=rng.integers(1, 3))
|
| 179 |
+
+ f[low_idx] *= (1.0 + rng.normal(0, 0.05 * sigma, size=len(low_idx)))
|
| 180 |
+
+ seq = np.fft.irfft(f, n=n)
|
| 181 |
+
+
|
| 182 |
+
+ elif m_type < 0.97: # Symmetry-aware Block Perturbation
|
| 183 |
+
blen = rng.integers(2, max(5, n // 10))
|
| 184 |
+
bstart = rng.integers(0, n - blen)
|
| 185 |
+
- delta = rng.normal(0, sigma, size=blen)
|
| 186 |
+
+ delta = rng.normal(0, 0.5 * sigma, size=blen)
|
| 187 |
+
seq[bstart : bstart + blen] += delta
|
| 188 |
+
- if was_symmetric: seq[n - bstart - blen : n - bstart] += delta[::-1]
|
| 189 |
+
- elif m_type < 0.15: # Scattered perturbation
|
| 190 |
+
- num = rng.integers(1, max(2, n // 30))
|
| 191 |
+
- pix = rng.choice(n, size=num, replace=False)
|
| 192 |
+
- seq[pix] += rng.normal(0, sigma, size=num)
|
| 193 |
+
- elif m_type < 0.55: # Unified Super-Sharpened Gradient Step
|
| 194 |
+
- c = np.convolve(seq, seq)
|
| 195 |
+
- max_c, sum_a = np.max(c), float(np.sum(seq))
|
| 196 |
+
- beta = 40.0 + 360.0 * (progress**1.5)
|
| 197 |
+
- w = np.exp(beta * (c / (max_c + 1e-12) - 1.0))
|
| 198 |
+
- w /= (np.sum(w) + 1e-15)
|
| 199 |
+
- grad = np.convolve(w, seq[::-1], mode='full')[n-1 : 2*n-1]
|
| 200 |
+
- rel_grad = (grad / (max_c + 1e-12)) - (1.0 / (sum_a + 1e-12))
|
| 201 |
+
- t_size = rng.integers(1, max(2, n // 20))
|
| 202 |
+
- if rng.random() < 0.6: # Reduction of peak-contributing indices
|
| 203 |
+
- target_idx = np.argsort(rel_grad)[-t_size:]
|
| 204 |
+
- seq[target_idx] *= (1.0 - sigma * rng.uniform(0.1, 0.5, size=len(target_idx)))
|
| 205 |
+
- else: # Boost of efficient indices
|
| 206 |
+
- target_idx = np.argsort(rel_grad)[:t_size]
|
| 207 |
+
- seq[target_idx] *= (1.0 + sigma * rng.uniform(0.1, 0.5, size=len(target_idx)))
|
| 208 |
+
- elif m_type < 0.65: # Envelope Smoothing
|
| 209 |
+
- seq = 0.8 * seq + 0.1 * (np.roll(seq, 1) + np.roll(seq, -1))
|
| 210 |
+
- elif m_type < 0.80: # Peak Pressure Move
|
| 211 |
+
- c = np.convolve(seq, seq)
|
| 212 |
+
- p_idx = np.argmax(c)
|
| 213 |
+
- i_range = np.arange(max(0, p_idx - n + 1), min(n, p_idx + 1))
|
| 214 |
+
- contrib = seq[i_range] * seq[p_idx - i_range]
|
| 215 |
+
- t_size = rng.integers(1, max(2, n // 30))
|
| 216 |
+
- target_idx = i_range[np.argsort(contrib)[-t_size:]]
|
| 217 |
+
- seq[target_idx] *= (1.0 - sigma)
|
| 218 |
+
- elif m_type < 0.88: # Coupled Peak-to-Gap Mass Migration
|
| 219 |
+
- c = np.convolve(seq, seq)
|
| 220 |
+
- max_c = np.max(c)
|
| 221 |
+
- w = np.exp(100.0 * (c / (max_c + 1e-12) - 1.0))
|
| 222 |
+
- grad = np.convolve(w, seq[::-1], mode='full')[n-1 : 2*n-1]
|
| 223 |
+
- idx_red = np.argsort(grad)[-rng.integers(1, 6):]
|
| 224 |
+
- idx_bst = np.argsort(grad)[:rng.integers(1, 6)]
|
| 225 |
+
- for r_idx in idx_red:
|
| 226 |
+
- transfer = seq[r_idx] * sigma * rng.uniform(0.1, 0.4)
|
| 227 |
+
- seq[r_idx] -= transfer
|
| 228 |
+
- seq[rng.choice(idx_bst)] += transfer
|
| 229 |
+
- elif m_type < 0.94: # Selective Spectral Damping
|
| 230 |
+
- f = np.fft.rfft(seq)
|
| 231 |
+
- cutoff = max(1, int(len(f) * 0.15))
|
| 232 |
+
- f[cutoff:] *= (1.0 - 0.5 * sigma)
|
| 233 |
+
- low_idx = rng.integers(1, cutoff, size=rng.integers(1, 4))
|
| 234 |
+
- f[low_idx] *= (1.0 + rng.normal(0, 0.1 * sigma, size=len(low_idx)))
|
| 235 |
+
- seq = np.fft.irfft(f, n=n)
|
| 236 |
+
- elif m_type < 0.98: # Local scaling
|
| 237 |
+
- blen = rng.integers(5, max(10, n // 6))
|
| 238 |
+
- bstart = rng.integers(0, n - blen)
|
| 239 |
+
- seq[bstart : bstart + blen] *= rng.uniform(1.0 - sigma, 1.0 + sigma)
|
| 240 |
+
- else: # Symmetry mirror
|
| 241 |
+
- mid = n // 2
|
| 242 |
+
- if rng.random() < 0.5: seq[mid:] = seq[:mid][::-1] if n % 2 == 0 else seq[:mid+1][::-1]
|
| 243 |
+
- else: seq[:mid] = seq[n-mid:][::-1]
|
| 244 |
+
+ if was_symmetric or rng.random() < 0.5:
|
| 245 |
+
+ seq[n - bstart - blen : n - bstart] += delta[::-1]
|
| 246 |
+
+
|
| 247 |
+
+ else: # Mirror sequence to enforce symmetry early
|
| 248 |
+
+ if rng.random() < 0.5:
|
| 249 |
+
+ seq[n//2:] = seq[:n-n//2][::-1]
|
| 250 |
+
+ else:
|
| 251 |
+
+ seq[:n//2] = seq[n-n//2:][::-1]
|
| 252 |
+
|
| 253 |
+
- if (was_symmetric or progress > 0.88) and m_type < 0.98:
|
| 254 |
+
- if progress > 0.92 or rng.random() < (0.7 + 0.3 * progress):
|
| 255 |
+
- seq = (seq + seq[::-1]) / 2.0
|
| 256 |
+
+ # Symmetry hardening in the final phase
|
| 257 |
+
+ if progress > 0.88:
|
| 258 |
+
+ seq = (seq + seq[::-1]) / 2.0
|
| 259 |
+
+ elif was_symmetric and m_type < 0.98:
|
| 260 |
+
+ seq = (seq + seq[::-1]) / 2.0
|
| 261 |
+
|
| 262 |
+
seq = _normalize_scale(seq)
|
| 263 |
+
- v = 2.0 * np.max(np.convolve(seq, seq)) / n
|
| 264 |
+
- if v < best_val:
|
| 265 |
+
- best_seq, best_val = seq, v
|
| 266 |
+
+ # Efficient evaluation of scale-invariant part
|
| 267 |
+
+ new_c = np.convolve(seq, seq)
|
| 268 |
+
+ val = 2.0 * n * np.max(new_c) / (np.sum(seq)**2)
|
| 269 |
+
+
|
| 270 |
+
+ if val < best_val:
|
| 271 |
+
+ best_seq, best_val = seq, val
|
| 272 |
+
|
| 273 |
+
return [float(x) for x in best_seq.tolist()]
|
| 274 |
+
|
| 275 |
+
-
|
| 276 |
+
# EVOLVE-BLOCK-END
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/main.py
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVOLVE-BLOCK-START
|
| 2 |
+
"""
|
| 3 |
+
Surgical gradient refinement for the AlphaEvolve AC inequality task.
|
| 4 |
+
Optimizes a non-negative sequence to minimize 2*n*max(convolve(a,a)) / (sum(a)^2).
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
def evaluate_sequence(sequence: list[float]) -> float:
|
| 8 |
+
"""
|
| 9 |
+
Evaluate coefficient sequence with safety checks.
|
| 10 |
+
Lower is better.
|
| 11 |
+
"""
|
| 12 |
+
if not isinstance(sequence, list) or not sequence:
|
| 13 |
+
return float(np.inf)
|
| 14 |
+
|
| 15 |
+
clean: list[float] = []
|
| 16 |
+
for x in sequence:
|
| 17 |
+
if isinstance(x, bool) or not isinstance(x, (int, float)):
|
| 18 |
+
return float(np.inf)
|
| 19 |
+
if np.isnan(x) or np.isinf(x):
|
| 20 |
+
return float(np.inf)
|
| 21 |
+
clean.append(float(x))
|
| 22 |
+
|
| 23 |
+
clean = [max(0.0, min(1000.0, x)) for x in clean]
|
| 24 |
+
n = len(clean)
|
| 25 |
+
conv = np.convolve(clean, clean)
|
| 26 |
+
max_b = float(np.max(conv))
|
| 27 |
+
sum_a = float(np.sum(clean))
|
| 28 |
+
if sum_a < 1e-6:
|
| 29 |
+
return float(np.inf)
|
| 30 |
+
return float(2.0 * n * max_b / (sum_a**2))
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def _normalize_scale(seq: np.ndarray) -> np.ndarray:
|
| 34 |
+
"""Scale sequence to sum to its length while maintaining nonnegativity."""
|
| 35 |
+
s = np.clip(np.asarray(seq, dtype=np.float64), 0.0, 1000.0)
|
| 36 |
+
total = np.sum(s)
|
| 37 |
+
if total <= 1e-12:
|
| 38 |
+
return np.ones_like(s)
|
| 39 |
+
return s * (len(s) / total)
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 43 |
+
"""Seeds focusing on power-laws and symmetric hills."""
|
| 44 |
+
x = np.linspace(0.0, 1.0, n, endpoint=True)
|
| 45 |
+
mode = rng.integers(0, 6)
|
| 46 |
+
if mode == 0:
|
| 47 |
+
base = np.ones(n)
|
| 48 |
+
elif mode == 1: # Symmetric Power Law (Ideal structure for this task)
|
| 49 |
+
p = rng.uniform(0.45, 0.55)
|
| 50 |
+
base = (np.arange(n) + 1.0)**(-p) + (n - np.arange(n))**(-p)
|
| 51 |
+
elif mode == 2: # Root-sine hill
|
| 52 |
+
base = np.sqrt(np.sin(np.pi * x) + 0.1)
|
| 53 |
+
elif mode == 3: # Asymmetric Power Law
|
| 54 |
+
p = rng.uniform(0.45, 0.55)
|
| 55 |
+
base = (np.arange(n) + 1.0)**(-p)
|
| 56 |
+
elif mode == 4: # Gaussian
|
| 57 |
+
base = np.exp(-0.5 * ((x - 0.5) / 0.2)**2)
|
| 58 |
+
else: # Symmetric 'Bowl'
|
| 59 |
+
base = 1.0 + 0.5 * (x - 0.5)**2
|
| 60 |
+
|
| 61 |
+
noise = rng.normal(0.0, 0.02, n)
|
| 62 |
+
seq = base + noise
|
| 63 |
+
if rng.random() < 0.7:
|
| 64 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 65 |
+
return _normalize_scale(seq)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 69 |
+
"""Search for optimal sequence using exponentiated gradient moves and resolution scaling."""
|
| 70 |
+
rng = np.random.default_rng(seed)
|
| 71 |
+
start_time = time.time()
|
| 72 |
+
deadline = start_time + max(0.1, budget_s * 0.98)
|
| 73 |
+
|
| 74 |
+
# Initial seeding phase at low resolution
|
| 75 |
+
best_seq = _normalize_scale(np.ones(128))
|
| 76 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 77 |
+
|
| 78 |
+
for n_init in [128, 256, 384]:
|
| 79 |
+
for _ in range(8):
|
| 80 |
+
seq = _seed_sequence(rng, n_init)
|
| 81 |
+
val = evaluate_sequence(seq.tolist())
|
| 82 |
+
if val < best_val:
|
| 83 |
+
best_seq, best_val = seq, val
|
| 84 |
+
|
| 85 |
+
# Multi-resolution optimization
|
| 86 |
+
resolutions = [128, 256, 512, 768]
|
| 87 |
+
time_shares = [0.06, 0.18, 0.42, 1.0] # Skew time heavily toward final res
|
| 88 |
+
|
| 89 |
+
for idx, target_n in enumerate(resolutions):
|
| 90 |
+
if target_n != best_seq.size:
|
| 91 |
+
best_seq = np.interp(np.linspace(0, 1, target_n), np.linspace(0, 1, best_seq.size), best_seq)
|
| 92 |
+
best_seq = _normalize_scale(best_seq)
|
| 93 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 94 |
+
|
| 95 |
+
res_deadline = start_time + time_shares[idx] * (deadline - start_time)
|
| 96 |
+
while time.time() < res_deadline:
|
| 97 |
+
progress = (time.time() - start_time) / (deadline - start_time + 1e-9)
|
| 98 |
+
# sigma decays as refinement progresses
|
| 99 |
+
sigma = 0.20 * (1.0 - progress)**1.1
|
| 100 |
+
seq = best_seq.copy()
|
| 101 |
+
n = seq.size
|
| 102 |
+
was_symmetric = np.allclose(seq, seq[::-1], atol=1e-8)
|
| 103 |
+
|
| 104 |
+
m_type = rng.random()
|
| 105 |
+
if m_type < 0.85: # Surgical Exponentiated Gradient Move
|
| 106 |
+
c = np.convolve(seq, seq)
|
| 107 |
+
max_c = np.max(c)
|
| 108 |
+
sum_a = np.sum(seq)
|
| 109 |
+
|
| 110 |
+
# Sharpen peak focus over time
|
| 111 |
+
beta = 50.0 + 450.0 * (progress**1.2)
|
| 112 |
+
# Compute softmax weights of the convolution peaks
|
| 113 |
+
# Subtracting max(beta*(...)) for numerical stability
|
| 114 |
+
w = np.exp(beta * (c / (max_c + 1e-12) - 1.0))
|
| 115 |
+
w /= (np.sum(w) + 1e-15)
|
| 116 |
+
|
| 117 |
+
# Gradient of sum(w*C) with respect to sequence 'a'
|
| 118 |
+
grad = np.convolve(w, seq[::-1], mode='valid')
|
| 119 |
+
|
| 120 |
+
# rel_grad_log is the gradient of the log-objective with respect to log(a_i)
|
| 121 |
+
# d log(max_c)/d log(a_i) = (a_i/max_c) * (2*grad_i)
|
| 122 |
+
# d log(sum_a^2)/d log(a_i) = (a_i/(sum_a^2)) * (2*sum_a) = 2*a_i/sum_a
|
| 123 |
+
rel_grad_log = (grad * seq / (max_c + 1e-12)) - (seq / (sum_a + 1e-12))
|
| 124 |
+
|
| 125 |
+
# Exponentiated gradient step
|
| 126 |
+
step_size = 0.8 * sigma
|
| 127 |
+
seq *= np.exp(-step_size * rel_grad_log * n)
|
| 128 |
+
|
| 129 |
+
elif m_type < 0.92: # Spectral Smoothing and Low-Frequency Jitter
|
| 130 |
+
f = np.fft.rfft(seq)
|
| 131 |
+
# Suppress high-frequency noise that doesn't help flatten convolution
|
| 132 |
+
cutoff = max(1, int(len(f) * (0.15 + 0.1 * (1.0 - progress))))
|
| 133 |
+
f[cutoff:] *= (1.0 - 0.5 * sigma)
|
| 134 |
+
# Small low-frequency perturbation for global shape exploration
|
| 135 |
+
low_idx = rng.integers(1, cutoff, size=rng.integers(1, 3))
|
| 136 |
+
f[low_idx] *= (1.0 + rng.normal(0, 0.05 * sigma, size=len(low_idx)))
|
| 137 |
+
seq = np.fft.irfft(f, n=n)
|
| 138 |
+
|
| 139 |
+
elif m_type < 0.97: # Symmetry-aware Block Perturbation
|
| 140 |
+
blen = rng.integers(2, max(5, n // 10))
|
| 141 |
+
bstart = rng.integers(0, n - blen)
|
| 142 |
+
delta = rng.normal(0, 0.5 * sigma, size=blen)
|
| 143 |
+
seq[bstart : bstart + blen] += delta
|
| 144 |
+
if was_symmetric or rng.random() < 0.5:
|
| 145 |
+
seq[n - bstart - blen : n - bstart] += delta[::-1]
|
| 146 |
+
|
| 147 |
+
else: # Mirror sequence to enforce symmetry early
|
| 148 |
+
if rng.random() < 0.5:
|
| 149 |
+
seq[n//2:] = seq[:n-n//2][::-1]
|
| 150 |
+
else:
|
| 151 |
+
seq[:n//2] = seq[n-n//2:][::-1]
|
| 152 |
+
|
| 153 |
+
# Symmetry hardening in the final phase
|
| 154 |
+
if progress > 0.88:
|
| 155 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 156 |
+
elif was_symmetric and m_type < 0.98:
|
| 157 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 158 |
+
|
| 159 |
+
seq = _normalize_scale(seq)
|
| 160 |
+
# Efficient evaluation of scale-invariant part
|
| 161 |
+
new_c = np.convolve(seq, seq)
|
| 162 |
+
val = 2.0 * n * np.max(new_c) / (np.sum(seq)**2)
|
| 163 |
+
|
| 164 |
+
if val < best_val:
|
| 165 |
+
best_seq, best_val = seq, val
|
| 166 |
+
|
| 167 |
+
return [float(x) for x in best_seq.tolist()]
|
| 168 |
+
|
| 169 |
+
# EVOLVE-BLOCK-END
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/original.py
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVOLVE-BLOCK-START
|
| 2 |
+
"""Initial search baseline for the AlphaEvolve AC inequality task."""
|
| 3 |
+
|
| 4 |
+
import time
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def evaluate_sequence(sequence: list[float]) -> float:
|
| 9 |
+
"""
|
| 10 |
+
Evaluate coefficient sequence with safety checks.
|
| 11 |
+
Lower is better.
|
| 12 |
+
"""
|
| 13 |
+
if not isinstance(sequence, list):
|
| 14 |
+
return float(np.inf)
|
| 15 |
+
if not sequence:
|
| 16 |
+
return float(np.inf)
|
| 17 |
+
|
| 18 |
+
clean: list[float] = []
|
| 19 |
+
for x in sequence:
|
| 20 |
+
if isinstance(x, bool) or not isinstance(x, (int, float)):
|
| 21 |
+
return float(np.inf)
|
| 22 |
+
if np.isnan(x) or np.isinf(x):
|
| 23 |
+
return float(np.inf)
|
| 24 |
+
clean.append(float(x))
|
| 25 |
+
|
| 26 |
+
clean = [max(0.0, min(1000.0, x)) for x in clean]
|
| 27 |
+
n = len(clean)
|
| 28 |
+
conv = np.convolve(clean, clean)
|
| 29 |
+
max_b = float(np.max(conv))
|
| 30 |
+
sum_a = float(np.sum(clean))
|
| 31 |
+
if sum_a < 0.01:
|
| 32 |
+
return float(np.inf)
|
| 33 |
+
return float(2.0 * n * max_b / (sum_a**2))
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def _normalize_scale(seq: np.ndarray) -> np.ndarray:
|
| 37 |
+
"""Scale sequence to sum to n while maintaining nonnegativity."""
|
| 38 |
+
s = np.clip(np.asarray(seq, dtype=np.float64), 0.0, None)
|
| 39 |
+
total = np.sum(s)
|
| 40 |
+
if total <= 1e-12:
|
| 41 |
+
return np.ones_like(s)
|
| 42 |
+
return s * (len(s) / total)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 46 |
+
"""Diverse seeds focusing on power laws and structured hills."""
|
| 47 |
+
x = np.linspace(0.0, 1.0, n, endpoint=True)
|
| 48 |
+
mode = rng.integers(0, 6)
|
| 49 |
+
if mode == 0:
|
| 50 |
+
base = np.ones(n)
|
| 51 |
+
elif mode == 1: # Symmetric Power Law (Promising structure for AC inequality)
|
| 52 |
+
p = rng.uniform(0.42, 0.58)
|
| 53 |
+
base = (np.arange(n) + 1.0)**(-p) + (n - np.arange(n))**(-p)
|
| 54 |
+
elif mode == 2: # Asymmetric Power Law
|
| 55 |
+
p = rng.uniform(0.42, 0.58)
|
| 56 |
+
base = (np.arange(n) + 1.0)**(-p)
|
| 57 |
+
elif mode == 3: # Sine Hill
|
| 58 |
+
base = 1.0 + 0.6 * np.sin(np.pi * x)
|
| 59 |
+
elif mode == 4: # Gaussian
|
| 60 |
+
base = np.exp(-0.5 * ((x - 0.5) / 0.18)**2)
|
| 61 |
+
else: # Quadratic Bowl
|
| 62 |
+
base = 1.0 + 0.6 * (x - 0.5)**2
|
| 63 |
+
|
| 64 |
+
if rng.random() < 0.3:
|
| 65 |
+
base += 0.1 * rng.normal(0, 1, n)
|
| 66 |
+
|
| 67 |
+
seq = base + rng.normal(0.0, 0.02, n)
|
| 68 |
+
if rng.random() < 0.5:
|
| 69 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 70 |
+
return _normalize_scale(seq)
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 74 |
+
"""Search for a low-value nonnegative sequence using a sensitivity-based gradient and targeted moves."""
|
| 75 |
+
del kwargs
|
| 76 |
+
rng = np.random.default_rng(seed)
|
| 77 |
+
start_time = time.time()
|
| 78 |
+
deadline = start_time + max(0.1, budget_s * 0.98)
|
| 79 |
+
|
| 80 |
+
best_seq = _normalize_scale(np.ones(128))
|
| 81 |
+
best_val = 2.0 * np.max(np.convolve(best_seq, best_seq)) / best_seq.size
|
| 82 |
+
|
| 83 |
+
# Seeding
|
| 84 |
+
for n_init in [128, 256, 512]:
|
| 85 |
+
for _ in range(8):
|
| 86 |
+
seq = _seed_sequence(rng, n_init)
|
| 87 |
+
v = 2.0 * np.max(np.convolve(seq, seq)) / seq.size
|
| 88 |
+
if v < best_val:
|
| 89 |
+
best_seq, best_val = seq, v
|
| 90 |
+
|
| 91 |
+
resolutions = [128, 256, 512, 768]
|
| 92 |
+
time_shares = [0.08, 0.20, 0.45, 1.0]
|
| 93 |
+
for idx, target_n in enumerate(resolutions):
|
| 94 |
+
if target_n > best_seq.size:
|
| 95 |
+
best_seq = np.interp(np.linspace(0, 1, target_n), np.linspace(0, 1, best_seq.size), best_seq)
|
| 96 |
+
best_seq = _normalize_scale(best_seq)
|
| 97 |
+
best_val = 2.0 * np.max(np.convolve(best_seq, best_seq)) / best_seq.size
|
| 98 |
+
|
| 99 |
+
res_deadline = start_time + time_shares[idx] * (deadline - start_time)
|
| 100 |
+
while time.time() < res_deadline:
|
| 101 |
+
progress = (time.time() - start_time) / (deadline - start_time + 1e-9)
|
| 102 |
+
sigma = 0.15 * (1.0 - progress)**1.1
|
| 103 |
+
seq = best_seq.copy()
|
| 104 |
+
n = seq.size
|
| 105 |
+
was_symmetric = np.allclose(seq, seq[::-1], atol=1e-8)
|
| 106 |
+
m_type = rng.random()
|
| 107 |
+
|
| 108 |
+
if m_type < 0.08: # Block perturbation
|
| 109 |
+
blen = rng.integers(2, max(5, n // 10))
|
| 110 |
+
bstart = rng.integers(0, n - blen)
|
| 111 |
+
delta = rng.normal(0, sigma, size=blen)
|
| 112 |
+
seq[bstart : bstart + blen] += delta
|
| 113 |
+
if was_symmetric: seq[n - bstart - blen : n - bstart] += delta[::-1]
|
| 114 |
+
elif m_type < 0.15: # Scattered perturbation
|
| 115 |
+
num = rng.integers(1, max(2, n // 30))
|
| 116 |
+
pix = rng.choice(n, size=num, replace=False)
|
| 117 |
+
seq[pix] += rng.normal(0, sigma, size=num)
|
| 118 |
+
elif m_type < 0.55: # Unified Super-Sharpened Gradient Step
|
| 119 |
+
c = np.convolve(seq, seq)
|
| 120 |
+
max_c, sum_a = np.max(c), float(np.sum(seq))
|
| 121 |
+
beta = 40.0 + 360.0 * (progress**1.5)
|
| 122 |
+
w = np.exp(beta * (c / (max_c + 1e-12) - 1.0))
|
| 123 |
+
w /= (np.sum(w) + 1e-15)
|
| 124 |
+
grad = np.convolve(w, seq[::-1], mode='full')[n-1 : 2*n-1]
|
| 125 |
+
rel_grad = (grad / (max_c + 1e-12)) - (1.0 / (sum_a + 1e-12))
|
| 126 |
+
t_size = rng.integers(1, max(2, n // 20))
|
| 127 |
+
if rng.random() < 0.6: # Reduction of peak-contributing indices
|
| 128 |
+
target_idx = np.argsort(rel_grad)[-t_size:]
|
| 129 |
+
seq[target_idx] *= (1.0 - sigma * rng.uniform(0.1, 0.5, size=len(target_idx)))
|
| 130 |
+
else: # Boost of efficient indices
|
| 131 |
+
target_idx = np.argsort(rel_grad)[:t_size]
|
| 132 |
+
seq[target_idx] *= (1.0 + sigma * rng.uniform(0.1, 0.5, size=len(target_idx)))
|
| 133 |
+
elif m_type < 0.65: # Envelope Smoothing
|
| 134 |
+
seq = 0.8 * seq + 0.1 * (np.roll(seq, 1) + np.roll(seq, -1))
|
| 135 |
+
elif m_type < 0.80: # Peak Pressure Move
|
| 136 |
+
c = np.convolve(seq, seq)
|
| 137 |
+
p_idx = np.argmax(c)
|
| 138 |
+
i_range = np.arange(max(0, p_idx - n + 1), min(n, p_idx + 1))
|
| 139 |
+
contrib = seq[i_range] * seq[p_idx - i_range]
|
| 140 |
+
t_size = rng.integers(1, max(2, n // 30))
|
| 141 |
+
target_idx = i_range[np.argsort(contrib)[-t_size:]]
|
| 142 |
+
seq[target_idx] *= (1.0 - sigma)
|
| 143 |
+
elif m_type < 0.88: # Coupled Peak-to-Gap Mass Migration
|
| 144 |
+
c = np.convolve(seq, seq)
|
| 145 |
+
max_c = np.max(c)
|
| 146 |
+
w = np.exp(100.0 * (c / (max_c + 1e-12) - 1.0))
|
| 147 |
+
grad = np.convolve(w, seq[::-1], mode='full')[n-1 : 2*n-1]
|
| 148 |
+
idx_red = np.argsort(grad)[-rng.integers(1, 6):]
|
| 149 |
+
idx_bst = np.argsort(grad)[:rng.integers(1, 6)]
|
| 150 |
+
for r_idx in idx_red:
|
| 151 |
+
transfer = seq[r_idx] * sigma * rng.uniform(0.1, 0.4)
|
| 152 |
+
seq[r_idx] -= transfer
|
| 153 |
+
seq[rng.choice(idx_bst)] += transfer
|
| 154 |
+
elif m_type < 0.94: # Selective Spectral Damping
|
| 155 |
+
f = np.fft.rfft(seq)
|
| 156 |
+
cutoff = max(1, int(len(f) * 0.15))
|
| 157 |
+
f[cutoff:] *= (1.0 - 0.5 * sigma)
|
| 158 |
+
low_idx = rng.integers(1, cutoff, size=rng.integers(1, 4))
|
| 159 |
+
f[low_idx] *= (1.0 + rng.normal(0, 0.1 * sigma, size=len(low_idx)))
|
| 160 |
+
seq = np.fft.irfft(f, n=n)
|
| 161 |
+
elif m_type < 0.98: # Local scaling
|
| 162 |
+
blen = rng.integers(5, max(10, n // 6))
|
| 163 |
+
bstart = rng.integers(0, n - blen)
|
| 164 |
+
seq[bstart : bstart + blen] *= rng.uniform(1.0 - sigma, 1.0 + sigma)
|
| 165 |
+
else: # Symmetry mirror
|
| 166 |
+
mid = n // 2
|
| 167 |
+
if rng.random() < 0.5: seq[mid:] = seq[:mid][::-1] if n % 2 == 0 else seq[:mid+1][::-1]
|
| 168 |
+
else: seq[:mid] = seq[n-mid:][::-1]
|
| 169 |
+
|
| 170 |
+
if (was_symmetric or progress > 0.88) and m_type < 0.98:
|
| 171 |
+
if progress > 0.92 or rng.random() < (0.7 + 0.3 * progress):
|
| 172 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 173 |
+
|
| 174 |
+
seq = _normalize_scale(seq)
|
| 175 |
+
v = 2.0 * np.max(np.convolve(seq, seq)) / n
|
| 176 |
+
if v < best_val:
|
| 177 |
+
best_seq, best_val = seq, v
|
| 178 |
+
|
| 179 |
+
return [float(x) for x in best_seq.tolist()]
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
# EVOLVE-BLOCK-END
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": false,
|
| 3 |
+
"error": "name 'np' is not defined"
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/results/metrics.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": 0.0,
|
| 3 |
+
"correct": false,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": 0.0,
|
| 6 |
+
"execution_time_mean": 0.0,
|
| 7 |
+
"execution_time_std": 0.0,
|
| 8 |
+
"num_successful_runs": 0,
|
| 9 |
+
"num_valid_runs": 0,
|
| 10 |
+
"num_invalid_runs": 0,
|
| 11 |
+
"all_validation_errors": [],
|
| 12 |
+
"correct": false,
|
| 13 |
+
"validation_error": "name 'np' is not defined"
|
| 14 |
+
},
|
| 15 |
+
"auxiliary": {},
|
| 16 |
+
"auxiliary_descriptions": {},
|
| 17 |
+
"timestamp": 1770954796.5973926,
|
| 18 |
+
"generation": 102
|
| 19 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_102/rewrite.txt
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
# EVOLVE-BLOCK-START
|
| 5 |
+
"""
|
| 6 |
+
Surgical gradient refinement for the AlphaEvolve AC inequality task.
|
| 7 |
+
Optimizes a non-negative sequence to minimize 2*n*max(convolve(a,a)) / (sum(a)^2).
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
def evaluate_sequence(sequence: list[float]) -> float:
|
| 11 |
+
"""
|
| 12 |
+
Evaluate coefficient sequence with safety checks.
|
| 13 |
+
Lower is better.
|
| 14 |
+
"""
|
| 15 |
+
if not isinstance(sequence, list) or not sequence:
|
| 16 |
+
return float(np.inf)
|
| 17 |
+
|
| 18 |
+
clean: list[float] = []
|
| 19 |
+
for x in sequence:
|
| 20 |
+
if isinstance(x, bool) or not isinstance(x, (int, float)):
|
| 21 |
+
return float(np.inf)
|
| 22 |
+
if np.isnan(x) or np.isinf(x):
|
| 23 |
+
return float(np.inf)
|
| 24 |
+
clean.append(float(x))
|
| 25 |
+
|
| 26 |
+
clean = [max(0.0, min(1000.0, x)) for x in clean]
|
| 27 |
+
n = len(clean)
|
| 28 |
+
conv = np.convolve(clean, clean)
|
| 29 |
+
max_b = float(np.max(conv))
|
| 30 |
+
sum_a = float(np.sum(clean))
|
| 31 |
+
if sum_a < 1e-6:
|
| 32 |
+
return float(np.inf)
|
| 33 |
+
return float(2.0 * n * max_b / (sum_a**2))
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def _normalize_scale(seq: np.ndarray) -> np.ndarray:
|
| 37 |
+
"""Scale sequence to sum to its length while maintaining nonnegativity."""
|
| 38 |
+
s = np.clip(np.asarray(seq, dtype=np.float64), 0.0, 1000.0)
|
| 39 |
+
total = np.sum(s)
|
| 40 |
+
if total <= 1e-12:
|
| 41 |
+
return np.ones_like(s)
|
| 42 |
+
return s * (len(s) / total)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def _seed_sequence(rng: np.random.Generator, n: int) -> np.ndarray:
|
| 46 |
+
"""Seeds focusing on power-laws and symmetric hills."""
|
| 47 |
+
x = np.linspace(0.0, 1.0, n, endpoint=True)
|
| 48 |
+
mode = rng.integers(0, 6)
|
| 49 |
+
if mode == 0:
|
| 50 |
+
base = np.ones(n)
|
| 51 |
+
elif mode == 1: # Symmetric Power Law (Ideal structure for this task)
|
| 52 |
+
p = rng.uniform(0.45, 0.55)
|
| 53 |
+
base = (np.arange(n) + 1.0)**(-p) + (n - np.arange(n))**(-p)
|
| 54 |
+
elif mode == 2: # Root-sine hill
|
| 55 |
+
base = np.sqrt(np.sin(np.pi * x) + 0.1)
|
| 56 |
+
elif mode == 3: # Asymmetric Power Law
|
| 57 |
+
p = rng.uniform(0.45, 0.55)
|
| 58 |
+
base = (np.arange(n) + 1.0)**(-p)
|
| 59 |
+
elif mode == 4: # Gaussian
|
| 60 |
+
base = np.exp(-0.5 * ((x - 0.5) / 0.2)**2)
|
| 61 |
+
else: # Symmetric 'Bowl'
|
| 62 |
+
base = 1.0 + 0.5 * (x - 0.5)**2
|
| 63 |
+
|
| 64 |
+
noise = rng.normal(0.0, 0.02, n)
|
| 65 |
+
seq = base + noise
|
| 66 |
+
if rng.random() < 0.7:
|
| 67 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 68 |
+
return _normalize_scale(seq)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def run(seed: int = 42, budget_s: float = 10.0, **kwargs) -> list[float]:
|
| 72 |
+
"""Search for optimal sequence using exponentiated gradient moves and resolution scaling."""
|
| 73 |
+
rng = np.random.default_rng(seed)
|
| 74 |
+
start_time = time.time()
|
| 75 |
+
deadline = start_time + max(0.1, budget_s * 0.98)
|
| 76 |
+
|
| 77 |
+
# Initial seeding phase at low resolution
|
| 78 |
+
best_seq = _normalize_scale(np.ones(128))
|
| 79 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 80 |
+
|
| 81 |
+
for n_init in [128, 256, 384]:
|
| 82 |
+
for _ in range(8):
|
| 83 |
+
seq = _seed_sequence(rng, n_init)
|
| 84 |
+
val = evaluate_sequence(seq.tolist())
|
| 85 |
+
if val < best_val:
|
| 86 |
+
best_seq, best_val = seq, val
|
| 87 |
+
|
| 88 |
+
# Multi-resolution optimization
|
| 89 |
+
resolutions = [128, 256, 512, 768]
|
| 90 |
+
time_shares = [0.06, 0.18, 0.42, 1.0] # Skew time heavily toward final res
|
| 91 |
+
|
| 92 |
+
for idx, target_n in enumerate(resolutions):
|
| 93 |
+
if target_n != best_seq.size:
|
| 94 |
+
best_seq = np.interp(np.linspace(0, 1, target_n), np.linspace(0, 1, best_seq.size), best_seq)
|
| 95 |
+
best_seq = _normalize_scale(best_seq)
|
| 96 |
+
best_val = evaluate_sequence(best_seq.tolist())
|
| 97 |
+
|
| 98 |
+
res_deadline = start_time + time_shares[idx] * (deadline - start_time)
|
| 99 |
+
while time.time() < res_deadline:
|
| 100 |
+
progress = (time.time() - start_time) / (deadline - start_time + 1e-9)
|
| 101 |
+
# sigma decays as refinement progresses
|
| 102 |
+
sigma = 0.20 * (1.0 - progress)**1.1
|
| 103 |
+
seq = best_seq.copy()
|
| 104 |
+
n = seq.size
|
| 105 |
+
was_symmetric = np.allclose(seq, seq[::-1], atol=1e-8)
|
| 106 |
+
|
| 107 |
+
m_type = rng.random()
|
| 108 |
+
if m_type < 0.85: # Surgical Exponentiated Gradient Move
|
| 109 |
+
c = np.convolve(seq, seq)
|
| 110 |
+
max_c = np.max(c)
|
| 111 |
+
sum_a = np.sum(seq)
|
| 112 |
+
|
| 113 |
+
# Sharpen peak focus over time
|
| 114 |
+
beta = 50.0 + 450.0 * (progress**1.2)
|
| 115 |
+
# Compute softmax weights of the convolution peaks
|
| 116 |
+
# Subtracting max(beta*(...)) for numerical stability
|
| 117 |
+
w = np.exp(beta * (c / (max_c + 1e-12) - 1.0))
|
| 118 |
+
w /= (np.sum(w) + 1e-15)
|
| 119 |
+
|
| 120 |
+
# Gradient of sum(w*C) with respect to sequence 'a'
|
| 121 |
+
grad = np.convolve(w, seq[::-1], mode='valid')
|
| 122 |
+
|
| 123 |
+
# rel_grad_log is the gradient of the log-objective with respect to log(a_i)
|
| 124 |
+
# d log(max_c)/d log(a_i) = (a_i/max_c) * (2*grad_i)
|
| 125 |
+
# d log(sum_a^2)/d log(a_i) = (a_i/(sum_a^2)) * (2*sum_a) = 2*a_i/sum_a
|
| 126 |
+
rel_grad_log = (grad * seq / (max_c + 1e-12)) - (seq / (sum_a + 1e-12))
|
| 127 |
+
|
| 128 |
+
# Exponentiated gradient step
|
| 129 |
+
step_size = 0.8 * sigma
|
| 130 |
+
seq *= np.exp(-step_size * rel_grad_log * n)
|
| 131 |
+
|
| 132 |
+
elif m_type < 0.92: # Spectral Smoothing and Low-Frequency Jitter
|
| 133 |
+
f = np.fft.rfft(seq)
|
| 134 |
+
# Suppress high-frequency noise that doesn't help flatten convolution
|
| 135 |
+
cutoff = max(1, int(len(f) * (0.15 + 0.1 * (1.0 - progress))))
|
| 136 |
+
f[cutoff:] *= (1.0 - 0.5 * sigma)
|
| 137 |
+
# Small low-frequency perturbation for global shape exploration
|
| 138 |
+
low_idx = rng.integers(1, cutoff, size=rng.integers(1, 3))
|
| 139 |
+
f[low_idx] *= (1.0 + rng.normal(0, 0.05 * sigma, size=len(low_idx)))
|
| 140 |
+
seq = np.fft.irfft(f, n=n)
|
| 141 |
+
|
| 142 |
+
elif m_type < 0.97: # Symmetry-aware Block Perturbation
|
| 143 |
+
blen = rng.integers(2, max(5, n // 10))
|
| 144 |
+
bstart = rng.integers(0, n - blen)
|
| 145 |
+
delta = rng.normal(0, 0.5 * sigma, size=blen)
|
| 146 |
+
seq[bstart : bstart + blen] += delta
|
| 147 |
+
if was_symmetric or rng.random() < 0.5:
|
| 148 |
+
seq[n - bstart - blen : n - bstart] += delta[::-1]
|
| 149 |
+
|
| 150 |
+
else: # Mirror sequence to enforce symmetry early
|
| 151 |
+
if rng.random() < 0.5:
|
| 152 |
+
seq[n//2:] = seq[:n-n//2][::-1]
|
| 153 |
+
else:
|
| 154 |
+
seq[:n//2] = seq[n-n//2:][::-1]
|
| 155 |
+
|
| 156 |
+
# Symmetry hardening in the final phase
|
| 157 |
+
if progress > 0.88:
|
| 158 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 159 |
+
elif was_symmetric and m_type < 0.98:
|
| 160 |
+
seq = (seq + seq[::-1]) / 2.0
|
| 161 |
+
|
| 162 |
+
seq = _normalize_scale(seq)
|
| 163 |
+
# Efficient evaluation of scale-invariant part
|
| 164 |
+
new_c = np.convolve(seq, seq)
|
| 165 |
+
val = 2.0 * n * np.max(new_c) / (np.sum(seq)**2)
|
| 166 |
+
|
| 167 |
+
if val < best_val:
|
| 168 |
+
best_seq, best_val = seq, val
|
| 169 |
+
|
| 170 |
+
return [float(x) for x in best_seq.tolist()]
|
| 171 |
+
|
| 172 |
+
# EVOLVE-BLOCK-END
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (11.4 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": true,
|
| 3 |
+
"error": null
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_103/results/metrics.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": -1.7035919462851012,
|
| 3 |
+
"correct": true,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": -1.7035919462851012,
|
| 6 |
+
"public": {
|
| 7 |
+
"best_value": 1.7035919462851012,
|
| 8 |
+
"best_length": 768,
|
| 9 |
+
"num_runs": 1
|
| 10 |
+
},
|
| 11 |
+
"private": {
|
| 12 |
+
"all_values": [
|
| 13 |
+
1.7035919462851012
|
| 14 |
+
],
|
| 15 |
+
"all_lengths": [
|
| 16 |
+
768
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"text_feedback": "Lower evaluate_sequence value is better. combined_score = -best_value.",
|
| 20 |
+
"execution_time_mean": 9.629194633103907,
|
| 21 |
+
"execution_time_std": 0.0,
|
| 22 |
+
"num_valid_runs": 1,
|
| 23 |
+
"num_invalid_runs": 0,
|
| 24 |
+
"all_validation_errors": [],
|
| 25 |
+
"correct": true,
|
| 26 |
+
"validation_error": null
|
| 27 |
+
},
|
| 28 |
+
"auxiliary": {},
|
| 29 |
+
"auxiliary_descriptions": {},
|
| 30 |
+
"timestamp": 1770954954.2171297,
|
| 31 |
+
"generation": 103
|
| 32 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (12.7 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": false,
|
| 3 |
+
"error": "name 'np' is not defined"
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_104/results/metrics.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": 0.0,
|
| 3 |
+
"correct": false,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": 0.0,
|
| 6 |
+
"execution_time_mean": 0.0,
|
| 7 |
+
"execution_time_std": 0.0,
|
| 8 |
+
"num_successful_runs": 0,
|
| 9 |
+
"num_valid_runs": 0,
|
| 10 |
+
"num_invalid_runs": 0,
|
| 11 |
+
"all_validation_errors": [],
|
| 12 |
+
"correct": false,
|
| 13 |
+
"validation_error": "name 'np' is not defined"
|
| 14 |
+
},
|
| 15 |
+
"auxiliary": {},
|
| 16 |
+
"auxiliary_descriptions": {},
|
| 17 |
+
"timestamp": 1770955012.723826,
|
| 18 |
+
"generation": 104
|
| 19 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/__pycache__/main.cpython-313.pyc
ADDED
|
Binary file (11.4 kB). View file
|
|
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/results/auxiliary_metrics_snapshot.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def evaluate_aux(results_dir, primary_result=None):
|
| 2 |
+
"""Return auxiliary metrics as a dict."""
|
| 3 |
+
return {}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/results/correct.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"correct": true,
|
| 3 |
+
"error": null
|
| 4 |
+
}
|
tasks/alphaevolve_ac/results/results_alphaevolve_ac_baseline_gen200_periodic1000_20260213_012331/gen_105/results/metrics.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"combined_score": -1.616379538404345,
|
| 3 |
+
"correct": true,
|
| 4 |
+
"primary": {
|
| 5 |
+
"combined_score": -1.616379538404345,
|
| 6 |
+
"public": {
|
| 7 |
+
"best_value": 1.616379538404345,
|
| 8 |
+
"best_length": 768,
|
| 9 |
+
"num_runs": 1
|
| 10 |
+
},
|
| 11 |
+
"private": {
|
| 12 |
+
"all_values": [
|
| 13 |
+
1.616379538404345
|
| 14 |
+
],
|
| 15 |
+
"all_lengths": [
|
| 16 |
+
768
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"text_feedback": "Lower evaluate_sequence value is better. combined_score = -best_value.",
|
| 20 |
+
"execution_time_mean": 9.625271708704531,
|
| 21 |
+
"execution_time_std": 0.0,
|
| 22 |
+
"num_valid_runs": 1,
|
| 23 |
+
"num_invalid_runs": 0,
|
| 24 |
+
"all_validation_errors": [],
|
| 25 |
+
"correct": true,
|
| 26 |
+
"validation_error": null
|
| 27 |
+
},
|
| 28 |
+
"auxiliary": {},
|
| 29 |
+
"auxiliary_descriptions": {},
|
| 30 |
+
"timestamp": 1770955062.0079255,
|
| 31 |
+
"generation": 105
|
| 32 |
+
}
|