Skip to content

Commit

Permalink
chore: move system name config setup inside run experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
sash-a committed Nov 20, 2024
1 parent 3264886 commit 9bd7be9
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion mava/advanced_usage/ff_ippo_store_experience.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> None:
"""Runs experiment."""
_config.logger.system_name = "ff_ippo"
# Logger setup
config = copy.deepcopy(_config)
logger = MavaLogger(config)
Expand Down Expand Up @@ -674,7 +675,6 @@ def hydra_entry_point(cfg: DictConfig) -> None:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_ippo"

# Run experiment.
run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/mat/anakin/mat.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "mat"
config = copy.deepcopy(_config)

n_devices = len(jax.devices())
Expand Down Expand Up @@ -586,7 +587,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "mat"

eval_performance = run_experiment(cfg)
jax.block_until_ready(eval_performance)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/ppo/anakin/ff_ippo.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "ff_ippo"
config = copy.deepcopy(_config)

n_devices = len(jax.devices())
Expand Down Expand Up @@ -583,7 +584,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_ippo"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/ppo/anakin/ff_mappo.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "ff_mappo"
config = copy.deepcopy(_config)

n_devices = len(jax.devices())
Expand Down Expand Up @@ -566,7 +567,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_mappo"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/ppo/anakin/rec_ippo.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "rec_ippo"
config = copy.deepcopy(_config)

n_devices = len(jax.devices())
Expand Down Expand Up @@ -734,7 +735,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "rec_ippo"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/ppo/anakin/rec_mappo.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "rec_mappo"
config = copy.deepcopy(_config)

n_devices = len(jax.devices())
Expand Down Expand Up @@ -728,7 +729,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "rec_mappo"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/ppo/sebulba/ff_ippo.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "ff_ippo_sebulba"
config = copy.deepcopy(_config)

local_devices = jax.local_devices()
Expand Down Expand Up @@ -739,7 +740,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_ippo_sebulba"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/q_learning/anakin/rec_iql.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ def update_step(

def run_experiment(cfg: DictConfig) -> float:
# Add runtime variables to config
cfg.logger.system_name = "rec_iql"
cfg.arch.n_devices = len(jax.devices())
cfg = check_total_timesteps(cfg)

Expand Down Expand Up @@ -627,7 +628,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "rec_iql"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/q_learning/anakin/rec_qmix.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ def update_step(


def run_experiment(cfg: DictConfig) -> float:
cfg.logger.system_name = "rec_qmix"
cfg.arch.n_devices = len(jax.devices())
cfg = check_total_timesteps(cfg)

Expand Down Expand Up @@ -676,7 +677,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "rec_qmix"
# Run experiment.
eval_performance = run_experiment(cfg)

Expand Down
2 changes: 1 addition & 1 deletion mava/systems/sable/anakin/ff_sable.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "ff_sable"
config = copy.deepcopy(_config)

n_devices = len(jax.devices())
Expand Down Expand Up @@ -655,7 +656,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_sable"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/sable/anakin/rec_sable.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ def learner_setup(

def run_experiment(_config: DictConfig) -> float:
"""Runs experiment."""
_config.logger.system_name = "rec_sable"
config = copy.deepcopy(_config)

n_devices = len(jax.devices())
Expand Down Expand Up @@ -685,7 +686,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "rec_sable"

# Run experiment.
eval_performance = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/sac/anakin/ff_hasac.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ def update_step(carry: LearnerState, _: Any) -> Tuple[LearnerState, Tuple[Metric

def run_experiment(cfg: DictConfig) -> float:
# Add runtime variables to config
cfg.logger.system_name = "ff_hasac"
cfg.arch.n_devices = len(jax.devices())
cfg = check_total_timesteps(cfg)

Expand Down Expand Up @@ -715,7 +716,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_hasac"

# Run experiment.
final_return = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/sac/anakin/ff_isac.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ def update_step(carry: LearnerState, _: Any) -> Tuple[LearnerState, Tuple[Metric

def run_experiment(cfg: DictConfig) -> float:
# Add runtime variables to config
cfg.logger.system_name = "ff_isac"
cfg.arch.n_devices = len(jax.devices())
cfg = check_total_timesteps(cfg)

Expand Down Expand Up @@ -614,7 +615,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_isac"

# Run experiment.
final_return = run_experiment(cfg)
Expand Down
2 changes: 1 addition & 1 deletion mava/systems/sac/anakin/ff_masac.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ def update_step(carry: LearnerState, _: Any) -> Tuple[LearnerState, Tuple[Metric

def run_experiment(cfg: DictConfig) -> float:
# Add runtime variables to config
cfg.logger.system_name = "ff_masac"
cfg.arch.n_devices = len(jax.devices())
cfg = check_total_timesteps(cfg)

Expand Down Expand Up @@ -627,7 +628,6 @@ def hydra_entry_point(cfg: DictConfig) -> float:
"""Experiment entry point."""
# Allow dynamic attributes.
OmegaConf.set_struct(cfg, False)
cfg.logger.system_name = "ff_masac"

# Run experiment.
final_return = run_experiment(cfg)
Expand Down

0 comments on commit 9bd7be9

Please sign in to comment.