@@ -624,7 +624,6 @@ def _handle_optimizer_results(self, results: tuple[Results, ...]) -> None:
624624 for batch_id , batch_dict in batch_dataframes .items ():
625625 target_ensemble = self ._experiment .get_ensemble_by_name (f"batch_{ batch_id } " )
626626 target_ensemble .save_batch_dataframes (dataframes = batch_dict )
627- target_ensemble .update_improvement_flag (is_improvement = False )
628627
629628 for r in results :
630629 batches = (
@@ -753,59 +752,6 @@ def objectives_config(self) -> EverestObjectivesConfig:
753752 assert isinstance (obj_config , EverestObjectivesConfig )
754753 return obj_config
755754
756- def _update_ensemble_improvement_flags (self ) -> None :
757- assert self ._experiment is not None
758-
759- # This a somewhat arbitrary threshold, this should be a user choice
760- # during visualization:
761- CONSTRAINT_TOL = 1e-6
762-
763- max_total_objective = np .inf
764- for ensemble in self ._experiment .ensembles_with_function_results :
765- assert ensemble .batch_objectives is not None
766- total_objective = ensemble .batch_objectives ["total_objective_value" ].item ()
767- bound_constraint_violation = (
768- 0.0
769- if ensemble .batch_bound_constraint_violations is None
770- else (
771- ensemble .batch_bound_constraint_violations .drop ("batch_id" )
772- .to_numpy ()
773- .max ()
774- .item ()
775- )
776- )
777- input_constraint_violation = (
778- 0.0
779- if ensemble .batch_input_constraint_violations is None
780- else (
781- ensemble .batch_input_constraint_violations .drop ("batch_id" )
782- .to_numpy ()
783- .max ()
784- .item ()
785- )
786- )
787- output_constraint_violation = (
788- 0.0
789- if ensemble .batch_output_constraint_violations is None
790- else (
791- ensemble .batch_output_constraint_violations .drop ("batch_id" )
792- .to_numpy ()
793- .max ()
794- .item ()
795- )
796- )
797- if (
798- max (
799- bound_constraint_violation ,
800- input_constraint_violation ,
801- output_constraint_violation ,
802- )
803- < CONSTRAINT_TOL
804- and total_objective < max_total_objective
805- ):
806- ensemble .update_improvement_flag (is_improvement = True )
807- max_total_objective = total_objective
808-
809755 def _create_experiment_storage (self ) -> LocalExperiment :
810756 return self ._storage .create_experiment (
811757 name = self .experiment_name , experiment_config = self .to_experiment_config ()
@@ -836,8 +782,6 @@ def run_experiment(
836782 # Run the optimization:
837783 optimizer_exit_code = optimizer .run (initial_guesses )
838784
839- # Store some final results.
840- self ._update_ensemble_improvement_flags ()
841785 if (
842786 optimizer_exit_code is not RoptExitCode .UNKNOWN
843787 and optimizer_exit_code is not RoptExitCode .TOO_FEW_REALIZATIONS
0 commit comments