Skip to content

Commit

Permalink
Merge pull request #2 from benellis3/ranges
Browse files Browse the repository at this point in the history
Merge ranges into master
  • Loading branch information
benellis3 authored Mar 28, 2023
2 parents 6ba4490 + 1b76500 commit 2ec0cd8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
pip install --upgrade pip
pip install --ignore-installed six
pip install sacred numpy scipy gym==0.10.8 matplotlib seaborn pyyaml pygame pytest probscale imageio snakeviz tensorboard-logger wandb
pip install -U git+https://github.com/benellis3/smac.git@smac-v2
pip install "protobuf<3.21" -U git+https://github.com/oxwhirl/smacv2.git@ranges
5 changes: 4 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ config=$1 # qmix
tag=$2
maps=${3:-sc2_gen_protoss,sc2_gen_terran,sc2_gen_zerg} # MMM2 left out
units=${8:-10}
offset=1
threads=${4:-9} # 2
td_lambdas=${9:-0.6}
eps_anneals=${10:-100000}
Expand All @@ -24,6 +25,7 @@ times=${7:-3} # 5

maps=(${maps//,/ })
units=(${units//,/ })
enemies=(${enemies//,/ })
gpus=(${gpus//,/ })
args=(${args//,/ })
td_lambdas=(${td_lambdas//,/ })
Expand Down Expand Up @@ -53,7 +55,8 @@ for tdlambda in "${td_lambdas[@]}"; 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 save_model=True "${args[@]}" &
enemies=$(($unit + $offset))
./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.n_enemies=$enemies use_wandb=True td_lambda=$tdlambda epsilon_anneal_time=$epsanneal save_model=True "${args[@]}" &

count=$(($count + 1))
if [ $(($count % $threads)) -eq 0 ]; then
Expand Down
6 changes: 4 additions & 2 deletions src/config/envs/sc2_gen_protoss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ env_args:
reward_win: 200
replay_dir: ""
replay_prefix: ""
conic_fov: True
conic_fov: False
use_unit_ranges: True
min_attack_range: 2
num_fov_actions: 12
obs_own_pos: True
capability_config:
n_units: 5
n_enemies: 5
team_gen:
dist_type: "weighted_teams"
unit_types:
Expand All @@ -42,7 +45,6 @@ env_args:
start_positions:
dist_type: "surrounded_and_reflect"
p: 0.5
n_enemies: 5
map_x: 32
map_y: 32

Expand Down
6 changes: 4 additions & 2 deletions src/config/envs/sc2_gen_terran.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ env_args:
reward_win: 200
replay_dir: ""
replay_prefix: ""
conic_fov: True
conic_fov: False
use_unit_ranges: True
min_attack_range: 2
num_fov_actions: 12
obs_own_pos: True
capability_config:
n_units: 5
n_enemies: 5
team_gen:
dist_type: "weighted_teams"
unit_types:
Expand All @@ -45,7 +48,6 @@ env_args:
start_positions:
dist_type: "surrounded_and_reflect"
p: 0.5
n_enemies: 5
map_x: 32
map_y: 32
# enemy_mask:
Expand Down
6 changes: 4 additions & 2 deletions src/config/envs/sc2_gen_zerg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ env_args:
reward_win: 200
replay_dir: ""
replay_prefix: ""
conic_fov: True
conic_fov: False
use_unit_ranges: True
min_attack_range: 2
num_fov_actions: 12
obs_own_pos: True
capability_config:
n_units: 5
n_enemies: 5
team_gen:
dist_type: "weighted_teams"
unit_types:
Expand All @@ -45,7 +48,6 @@ env_args:
start_positions:
dist_type: "surrounded_and_reflect"
p: 0.5
n_enemies: 5
map_x: 32
map_y: 32
# enemy_mask:
Expand Down

0 comments on commit 2ec0cd8

Please sign in to comment.