This pull request addresses several bugs and improvements in various trainer classes within the APE Core library. The main changes include:
Adding a best_score attribute to all trainer report classes in types/report.py.
Fixing logger usage in DspyMiproTrainer by importing and using the global logger.
Updating the train method in ExpelTrainer, FewShotTrainer, and TextGradientTrainer to properly set the best_score in their respective reports.
Modifying the TextGradientTrainer to handle early stopping when the score reaches 1.0, with different behavior based on the validation type.
Updating the OptunaTrainer to set the best_score in the report after optimization.
These changes aim to improve consistency across trainer implementations and provide more accurate reporting of training results.
Test
N/A
Changes that Break Backward Compatibility
The addition of the best_score attribute to all trainer report classes in types/report.py may potentially break backward compatibility for code that relies on the previous structure of these report classes. Users of the library may need to update their code to handle this new attribute.
Description
This pull request addresses several bugs and improvements in various trainer classes within the APE Core library. The main changes include:
best_score
attribute to all trainer report classes intypes/report.py
.DspyMiproTrainer
by importing and using the global logger.train
method inExpelTrainer
,FewShotTrainer
, andTextGradientTrainer
to properly set thebest_score
in their respective reports.TextGradientTrainer
to handle early stopping when the score reaches 1.0, with different behavior based on the validation type.OptunaTrainer
to set thebest_score
in the report after optimization.These changes aim to improve consistency across trainer implementations and provide more accurate reporting of training results.
Test
N/A
Changes that Break Backward Compatibility
The addition of the
best_score
attribute to all trainer report classes intypes/report.py
may potentially break backward compatibility for code that relies on the previous structure of these report classes. Users of the library may need to update their code to handle this new attribute.Documentation
N/A
Created with Palmier