Skip to content

Commit

Permalink
Also validate the other side
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Jul 23, 2024
1 parent cdd71e1 commit 60bd4f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mlos_core/mlos_core/spaces/adapters/llamatune.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ def transform(self, configuration: pd.DataFrame) -> pd.DataFrame:
orig_values_dict = self._transform(target_values_dict)
orig_configuration = normalize_config(self.orig_parameter_space, orig_values_dict)

# Validate that the configuration is in the original space.
try:
self.orig_parameter_space.check_configuration(orig_configuration)
except ConfigSpace.exceptions.IllegalValueError as e:
raise ValueError(
f"Invalid configuration {orig_configuration} generated by "
f"transformation of {target_configuration}:\n{e}"
) from e

# Add to inverse dictionary -- needed for registering the performance later
self._suggested_configs[orig_configuration] = target_configuration

Expand Down

0 comments on commit 60bd4f0

Please sign in to comment.