-
Notifications
You must be signed in to change notification settings - Fork 753
Add iteration_found field to track when best program was discovered #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add iteration_found field to track when best program was discovered #23
Conversation
|
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 |
|
I've updated the PR can you check now! |
|
I have applied Black formatting for consistency! |
|
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 |
…ature/add-iteration-found Add iteration_found field to track when best program was discovered
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:
The iteration when that best program was found
The current iteration (checkpoint iteration)