Skip to content

Commit

Permalink
add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDuToit committed Nov 1, 2024
1 parent 6eed2d2 commit 6378509
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mava/systems/ppo/anakin/ff_ippo.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ def run_experiment(_config: DictConfig) -> float:
config.system.num_updates > config.arch.num_evaluation
), "Number of updates per evaluation must be less than total number of updates."

assert (
config.arch.num_envs % config.system.num_minibatches == 0
), "Number of envs must be divisibile by number of minibatches."

# Calculate number of updates per evaluation.
config.system.num_updates_per_eval = config.system.num_updates // config.arch.num_evaluation
steps_per_rollout = (
Expand Down
4 changes: 4 additions & 0 deletions mava/systems/ppo/anakin/ff_mappo.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ def run_experiment(_config: DictConfig) -> float:
config.system.num_updates > config.arch.num_evaluation
), "Number of updates per evaluation must be less than total number of updates."

assert (
config.arch.num_envs % config.system.num_minibatches == 0
), "Number of envs must be divisibile by number of minibatches."

# Calculate number of updates per evaluation.
config.system.num_updates_per_eval = config.system.num_updates // config.arch.num_evaluation
steps_per_rollout = (
Expand Down
4 changes: 4 additions & 0 deletions mava/systems/ppo/anakin/rec_ippo.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,10 @@ def run_experiment(_config: DictConfig) -> float:
config.system.rollout_length % config.system.recurrent_chunk_size == 0
), "Rollout length must be divisible by recurrent chunk size."

assert (
config.arch.num_envs % config.system.num_minibatches == 0
), "Number of envs must be divisibile by number of minibatches."

# Create the enviroments for train and eval.
env, eval_env = environments.make(config)

Expand Down
4 changes: 4 additions & 0 deletions mava/systems/ppo/anakin/rec_mappo.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,10 @@ def run_experiment(_config: DictConfig) -> float:
config.system.rollout_length % config.system.recurrent_chunk_size == 0
), "Rollout length must be divisible by recurrent chunk size."

assert (
config.arch.num_envs % config.system.num_minibatches == 0
), "Number of envs must be divisibile by number of minibatches."

# Create the enviroments for train and eval.
env, eval_env = environments.make(config=config, add_global_state=True)

Expand Down

0 comments on commit 6378509

Please sign in to comment.