Skip to content

Commit

Permalink
More hyperparam changes
Browse files Browse the repository at this point in the history
  • Loading branch information
benellis3 committed May 12, 2022
1 parent d72c73f commit 891c44b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
37 changes: 23 additions & 14 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
trap 'onCtrlC' INT

set -x
function onCtrlC () {
echo 'Ctrl+C is captured'
for pid in $(jobs -p); do
Expand All @@ -16,6 +16,8 @@ tag=$2
maps=${3:-sc2_gen_protoss,sc2_gen_terran,sc2_gen_zerg} # MMM2 left out
units=${8:-5,15,50}
threads=${4:-8} # 2
td_lambdas=${9:-0.3}
eps_anneals=${10:-100000}
args=${5:-} # ""
gpus=${6:-0,1,2,3,4,5,6,7} # 0,1
times=${7:-3} # 5
Expand All @@ -24,6 +26,8 @@ maps=(${maps//,/ })
units=(${units//,/ })
gpus=(${gpus//,/ })
args=(${args//,/ })
td_lambdas=(${td_lambdas//,/ })
eps_anneals=(${eps_anneals//,/ })

if [ ! $config ] || [ ! $tag ]; then
echo "Please enter the correct command."
Expand All @@ -37,23 +41,28 @@ echo "THREADS:" $threads
echo "ARGS:" ${args[@]}
echo "GPU LIST:" ${gpus[@]}
echo "TIMES:" $times

echo "TDLAMBDAS:" ${td_lambdas[@]}
echo "EPSANNEALS:" ${eps_anneals[@]}

# run parallel
count=0
for map in "${maps[@]}"; do
for unit in "${units[@]}"; do
for((i=0;i<times;i++)); do
gpu=${gpus[$(($count % ${#gpus[@]}))]}
group="${config}-${map}-${tag}"
./run_docker.sh $gpu python3 src/main.py --config="$config" --env-config="$map" with group="$group" env_args.capability_config.n_units=$unit env_args.capability_config.start_positions.n_enemies=$unit use_wandb=True "${args[@]}" &
for tdlambda in "${td_lambdas[@]}"; do
for epsanneal in "${eps_anneals[@]}"; do
for map in "${maps[@]}"; do
for unit in "${units[@]}"; do
for((i=0;i<times;i++)); do
gpu=${gpus[$(($count % ${#gpus[@]}))]}
group="${config}-${map}-${tag}"
./run_docker.sh $gpu python3 src/main.py --config="$config" --env-config="$map" with group="$group" env_args.capability_config.n_units=$unit env_args.capability_config.start_positions.n_enemies=$unit use_wandb=True td_lambda=$tdlambda epsilon_anneal_time=$epsanneal "${args[@]}" &

count=$(($count + 1))
if [ $(($count % $threads)) -eq 0 ]; then
wait
fi
# for random seeds
sleep $((RANDOM % 60 + 60))
count=$(($count + 1))
if [ $(($count % $threads)) -eq 0 ]; then
wait
fi
# for random seeds
sleep $((RANDOM % 60 + 60))
done
done
done
done
done
Expand Down
2 changes: 1 addition & 1 deletion run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ NV_GPU="$GPU" ${cmd} run \
--user $(id -u) \
--memory 100g \
-v $(pwd):/source \
-t pymarl:ben_smac \
-t pymarl2:ben_smac \
${@:2}
2 changes: 1 addition & 1 deletion src/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buffer_cpu_only: True # If true we won't keep all of the replay buffer in vram
# --- Logging options ---
use_tensorboard: False # Log results to tensorboard
use_wandb: true
project: "smac_v2"
project: "smac_v2_hyperparams"
entity: "oxwhirl"
group: "ungrouped"
save_model: False # Save the models to disk
Expand Down

0 comments on commit 891c44b

Please sign in to comment.