Skip to content

Commit

Permalink
fix: fix artifacts naming
Browse files Browse the repository at this point in the history
  • Loading branch information
asawczyn committed Mar 9, 2022
1 parent daad2c8 commit e7641e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion embeddings/pipeline/hps_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,13 @@ def run(self, run_name: Optional[str] = None, **kwargs: Any) -> Tuple[pd.DataFra
return study.trials_dataframe(), metadata

def objective(self, trial: optuna.trial.Trial) -> float:
run_name = f"study_{trial.study.study_name}_trial_{trial.number}".replace("/", "__")

parameters = self.config_space.sample_parameters(trial=trial)
parsed_params = self.config_space.parse_parameters(parameters)
kwargs = self._get_evaluation_metadata(parsed_params)
pipeline = self._init_evaluation_pipeline(**kwargs)
results = pipeline.run(run_name=f"study_{trial.study.study_name}_trial_{trial.number}")
results = pipeline.run(run_name=run_name)
metric = results[self.metric_name][self.metric_key]
assert isinstance(metric, float)
return metric
Expand Down
2 changes: 1 addition & 1 deletion embeddings/pipeline/lightning_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def run(self, run_name: Optional[str] = None) -> Dict[str, Any]:
if self.logging_kwargs["use_wandb"]:
wandb.log_artifact(
str(self.output_path.joinpath(self.evaluation_filename)),
name=self.evaluation_filename,
name=f"{run_name}_{self.evaluation_filename}",
type="output",
)
wandb.finish()
Expand Down

0 comments on commit e7641e7

Please sign in to comment.