Download code/case2/train_all.sh from harryzhang1018/TestRandomization: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/harryzhang1018/TestRandomization/resolve/main/code/case2/train_all.sh
- Command line
-
hf download hf://datasets/harryzhang1018/TestRandomization/code/case2/train_all.sh
-
curl -L -o train_all.sh https://huggingface.co/datasets/harryzhang1018/TestRandomization/resolve/main/code/case2/train_all.sh
1.07 kB
| # Train the 24 Case 2 PPO policies: 3 training-noise configs (nonoise, release, robust) x 8 seeds. | |
| # Seeds 1001-1004: design policies (exploration, goal set A). Seeds 2001-2004: held-out policies (goal set B). | |
| # Each run is single-threaded and seeded (about 50 min on one core of a Ryzen 7 5800X). | |
| # Usage: ./train_all.sh [workers=10] [out_root=policies_retrained] (python: $PYTHON, default python) | |
| # The released policies in policies/ are not overwritten. Each run writes <out_root>/<config>_s<seed>/ | |
| # (ckpt_1..4.zip at 0.5/1.0/1.5/2.0 M steps, train_meta.json, episode_returns.npy); ckpt_4.zip is the policy. | |
| set -euo pipefail | |
| cd "$(dirname "$0")" | |
| WORKERS=${1:-10} | |
| OUT=${2:-policies_retrained} | |
| PY=${PYTHON:-python} | |
| mkdir -p "$OUT/logs" | |
| for s in 1001 1002 1003 1004 2001 2002 2003 2004; do | |
| for cfg in nonoise release robust; do echo "$cfg $s"; done | |
| done | xargs -P "$WORKERS" -L 1 bash -c 'OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 '"$PY"' train_ppo.py --config $0 --seed $1 --out '"$OUT"'/$0_s$1 > '"$OUT"'/logs/$0_s$1.log 2>&1 && echo done $0 $1' | |