summaryrefslogtreecommitdiff
path: root/scripts/run_ogb_mol_task_full.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/run_ogb_mol_task_full.sh')
-rwxr-xr-xscripts/run_ogb_mol_task_full.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/scripts/run_ogb_mol_task_full.sh b/scripts/run_ogb_mol_task_full.sh
new file mode 100755
index 0000000..b25bff3
--- /dev/null
+++ b/scripts/run_ogb_mol_task_full.sh
@@ -0,0 +1,54 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+cd "${ROOT_DIR}"
+export PYTHONPATH="${ROOT_DIR}:${PYTHONPATH:-}"
+
+TASK="${TASK:-ogbg-molhiv}"
+DEVICE="${DEVICE:-cuda:1}"
+EPOCHS="${EPOCHS:-100}"
+SEED="${SEED:-0}"
+HIDDEN="${HIDDEN:-128}"
+VIEWS="${VIEWS:-gin gine gcn graphsage gatv2 graphconv transformer pna gen film resgated tag sgc cheb arma mf appnp}"
+
+mkdir -p runs logs
+
+result_path() {
+ local view="$1"
+ local compute="$2"
+ local t="$3"
+ local ns="$4"
+ echo "runs/${TASK}_${view}_${compute}_T${t}_ns${ns}_h${HIDDEN}_e${EPOCHS}_s${SEED}.json"
+}
+
+run_cell() {
+ local view="$1"
+ local compute="$2"
+ local t="$3"
+ local ns="$4"
+ local out
+ out="$(result_path "${view}" "${compute}" "${t}" "${ns}")"
+ if [[ -f "${out}" ]]; then
+ echo "[skip] ${out}"
+ return
+ fi
+ echo "[run] ${TASK} view=${view} compute=${compute} T=${t} ns=${ns} device=${DEVICE}"
+ python3 -m rrog.cli run \
+ --task "${TASK}" \
+ --view "${view}" \
+ --compute "${compute}" \
+ --epochs "${EPOCHS}" \
+ --hidden "${HIDDEN}" \
+ --T "${t}" \
+ --n_sup "${ns}" \
+ --seed "${SEED}" \
+ --device "${DEVICE}"
+}
+
+for view in ${VIEWS}; do
+ run_cell "${view}" classic 0 1
+ run_cell "${view}" fixed-rrog 3 3
+done
+
+python3 -m rrog.cli results --epochs "${EPOCHS}"