Skip to content

Conversation

@hafeezhmha
Copy link
Contributor

Currently, the best_program_info.json file contains the current iteration number, not the iteration when the best program was actually discovered. This makes it difficult to analyze how quickly the algorithm finds better solutions.
When monitoring the progress using a command like:
watch -n 10 'jq ".metrics.combined_score, .iteration" "$(ls -d checkpoint_* | sort -V | tail -n1)/best_program_info.json"'
The iteration value shown is the checkpoint iteration, not when the best program was actually found.
Solution
Added iteration_found field to the Program class to track when a program was discovered during evolution
Updated the add method in ProgramDatabase to set this field when adding a new program
Modified the _save_checkpoint and _save_best_program methods to include the iteration_found field in the output JSON files
Updated initialization of the initial program to set its iteration_found value
Testing
Tested with the function_minimization example to confirm the field is correctly saved in best_program_info.json. The monitoring command can now be updated to:
watch -n 10 'jq ".metrics.combined_score, .iteration_found, .iteration" "$(ls -d checkpoint_* | sort -V | tail -n1)/best_program_info.json"'
This now correctly shows:

  1. The best program's score
    The iteration when that best program was found
    The current iteration (checkpoint iteration)

@CLAassistant
Copy link

CLAassistant commented May 23, 2025

CLA assistant check
All committers have signed the CLA.

@codelion
Copy link
Member

I don’t think we need to introduce another field for it? The iteration field in the best program info is supposed to track the iteration in which the best program was found.

@hafeezhmha
Copy link
Contributor Author

I don’t think we need to introduce another field for it? The iteration field in the best program info is supposed to track the iteration in which the best program was found.

that makes sense, lemme change it

@hafeezhmha
Copy link
Contributor Author

I've updated the PR can you check now!

@hafeezhmha
Copy link
Contributor Author

I have applied Black formatting for consistency!

@codelion
Copy link
Member

I think you ended up with commits from two different GH users, you will need to sign the CLA for both.

@hafeezhmha
Copy link
Contributor Author

I think you ended up with commits from two different GH users, you will need to sign the CLA for both.

okay done! i think it has no issues now

@codelion codelion merged commit f89e222 into algorithmicsuperintelligence:main May 23, 2025
3 checks passed
@hafeezhmha hafeezhmha deleted the feature/add-iteration-found branch May 29, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants