Download code/scripts/launch_camelyon.sh from nileshsarkar-ai/CausalGrok: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/nileshsarkar-ai/CausalGrok/resolve/main/code/scripts/launch_camelyon.sh
- Command line
-
hf download hf://nileshsarkar-ai/CausalGrok/code/scripts/launch_camelyon.sh
-
curl -L -o launch_camelyon.sh https://huggingface.co/nileshsarkar-ai/CausalGrok/resolve/main/code/scripts/launch_camelyon.sh
1.54 kB
| # scripts/launch_camelyon.sh — launch a Camelyon17 training run, detached via nohup. | |
| # | |
| # Usage: | |
| # bash scripts/launch_camelyon.sh [condition] [seed] [gpu] | |
| # | |
| # Defaults: | |
| # condition = grokking | |
| # seed = 42 | |
| # gpu = 0 | |
| # | |
| # Survives SSH disconnects. All artifacts in experiments/runs/<run_id>/. | |
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "$0")/.." && pwd)" | |
| cd "${ROOT}" | |
| source "${ROOT}/scripts/lib/nohup_runner.sh" | |
| source "${ROOT}/scripts/lib/env.sh" | |
| resolve_python | |
| CONDITION="${1:-grokking}" | |
| SEED="${2:-42}" | |
| GPU="${3:-0}" | |
| N_TRAIN="${N_TRAIN:-300}" | |
| WANDB_MODE_ARG="${WANDB_MODE:-offline}" | |
| EXTRA_ARGS="${EXTRA_ARGS:-}" | |
| STAMP="$(date -u +%Y%m%d-%H%M%S)" | |
| TAG_INFIX="" | |
| RUN_TAG="${RUN_TAG:-}" | |
| [[ -n "${RUN_TAG}" ]] && TAG_INFIX="_${RUN_TAG}" | |
| RUN_ID="${STAMP}_${CONDITION}${TAG_INFIX}_n${N_TRAIN}_s${SEED}" | |
| RUN_DIR="experiments/runs/${RUN_ID}" | |
| mkdir -p "${RUN_DIR}"/{logs,results,checkpoints,figures} | |
| echo "Launching CausalGrok Camelyon17 run" | |
| echo " condition : ${CONDITION}" | |
| echo " n_train : ${N_TRAIN}" | |
| echo " seed : ${SEED}" | |
| echo " GPU : ${GPU}" | |
| echo " run_id : ${RUN_ID}" | |
| read -r -a _extra <<<"${EXTRA_ARGS}" | |
| CUDA_VISIBLE_DEVICES="${GPU}" launch_detached "${RUN_DIR}" \ | |
| "${PYTHON}" -u -m experiments.causalgrok_camelyon_v2 \ | |
| --condition "${CONDITION}" \ | |
| --n_train "${N_TRAIN}" \ | |
| --seed "${SEED}" \ | |
| --run_dir "${RUN_DIR}" \ | |
| --wandb_project causalgrok \ | |
| --wandb_mode "${WANDB_MODE_ARG}" \ | |
| "${_extra[@]}" | |