-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
train_algos bash script, train_gcse_manual python script, yaml configs
- Loading branch information
Showing
5 changed files
with
86 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
env_id: "gcsenv" | ||
config: {} | ||
n_envs: 12 | ||
tensorboard: "/home/rstudio/logs" | ||
use_sde: True | ||
id: "1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# move to script directory for normalized relative paths. | ||
scriptdir="$(dirname "$0")" | ||
cd "$scriptdir" | ||
|
||
python train_gcse_manual.py -t 1000000 -a ppo -ne 10 & | ||
python train_gcse_manual.py -t 1000000 -a rppo -ne 10 & | ||
python train_gcse_manual.py -t 1000000 -a her -ne 10 & | ||
python train_gcse_manual.py -t 1000000 -a tqc -ne 10 & | ||
python train_gcse_manual.py -t 1000000 -a td3 & |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/opt/venv/bin/python | ||
import argparse | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-a", "--algo", help="Algo to train", type=str, | ||
choices=[ | ||
'PPO', 'RecurrentPPO', 'ppo', 'recurrentppo', | ||
'ARS', 'A2C', 'ars', 'a2c', | ||
'DDPG', 'ddpg', | ||
'HER', 'her', | ||
'SAC', 'sac' | ||
'TD3', 'td3', | ||
'TQC', 'tqc', | ||
] | ||
) | ||
parser.add_argument("-t", "--time-steps", help="N. timesteps to train for", type=int) | ||
parser.add_argument( | ||
"-ne", | ||
"--n-envs", | ||
help="Number of envs to use simultaneously for faster training. " | ||
"Check algos for compatibility with this arg.", | ||
type=int, | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
manual_kwargs = {} | ||
if args.algo: | ||
manual_kwargs['algo'] = args.algo | ||
if args.time_steps: | ||
manual_kwargs['time_steps'] = args.time_steps | ||
if args.n_envs: | ||
manual_kwargs['n_envs'] = args.n_envs | ||
|
||
import os | ||
boilerplate_cfg = os.path.join("..", "hyperpars", "gcse-boilerplate.yml") | ||
|
||
|
||
import rl4greencrab | ||
from rl4greencrab import sb3_train | ||
|
||
sb3_train(boilerplate_cfg, **manual_kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters