From 987f57d09532aa6afd2be5f919fce28e992dd700 Mon Sep 17 00:00:00 2001 From: Matteo Bettini Date: Fri, 6 Sep 2024 14:17:20 +0200 Subject: [PATCH] choose project name --- benchmarl/conf/experiment/base_experiment.yaml | 2 ++ benchmarl/experiment/experiment.py | 2 ++ benchmarl/experiment/logger.py | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/benchmarl/conf/experiment/base_experiment.yaml b/benchmarl/conf/experiment/base_experiment.yaml index 89566850..30d5d0ef 100644 --- a/benchmarl/conf/experiment/base_experiment.yaml +++ b/benchmarl/conf/experiment/base_experiment.yaml @@ -87,6 +87,8 @@ evaluation_deterministic_actions: True # List of loggers to use, options are: wandb, csv, tensorboard, mflow loggers: [] +# Wandb project name +project_name: "benchmarl" # Create a json folder as part of the output in the format of marl-eval create_json: True diff --git a/benchmarl/experiment/experiment.py b/benchmarl/experiment/experiment.py index 12fa8859..719c8a27 100644 --- a/benchmarl/experiment/experiment.py +++ b/benchmarl/experiment/experiment.py @@ -94,6 +94,7 @@ class ExperimentConfig: evaluation_deterministic_actions: bool = MISSING loggers: List[str] = MISSING + project_name: str = MISSING create_json: bool = MISSING save_folder: Optional[str] = MISSING @@ -535,6 +536,7 @@ def _setup_name(self): def _setup_logger(self): self.logger = Logger( + project_name=self.config.project_name, experiment_name=self.name, folder_name=str(self.folder_name), experiment_config=self.config, diff --git a/benchmarl/experiment/logger.py b/benchmarl/experiment/logger.py index 316ccad0..b389b7f6 100644 --- a/benchmarl/experiment/logger.py +++ b/benchmarl/experiment/logger.py @@ -33,6 +33,7 @@ def __init__( model_name: str, group_map: Dict[str, List[str]], seed: int, + project_name: str, ): self.experiment_config = experiment_config self.algorithm_name = algorithm_name @@ -63,7 +64,7 @@ def __init__( experiment_name=experiment_name, wandb_kwargs={ "group": task_name, - "project": "benchmarl", + "project": project_name, "id": experiment_name, }, )