Files
ultimate-ttt-bot/train.sh

24 lines
843 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Override with DEVICE=... ./train.sh if you want to force a specific device.
DEVICE="${DEVICE:-$(python -c 'import torch; print("cuda" if torch.cuda.is_available() else "cpu")')}"
OUTPUT_CHECKPOINT="${OUTPUT_CHECKPOINT:-easy.pth}"
# Example heavier runs:
DEVICE=cuda python run.py train --checkpoint hard.pth --arena-compare-games 4 --arena-compare-simulations 4 --num-simulations 25
DEVICE=cuda python run.py train --checkpoint medium.pth --arena-compare-games 3 --arena-compare-simulations 4 --num-simulations 20 --epochs 5 --num-eps 15 --num-iters 30
python run.py train \
--checkpoint "$OUTPUT_CHECKPOINT" \
--arena-compare-games 0 \
--arena-compare-simulations 2 \
--device "$DEVICE" \
--num-simulations 20 \
--epochs 3 \
--num-eps 10 \
--num-iters 15 \
"$@"
echo "Training finished!"