summaryrefslogtreecommitdiff
path: root/scripts/run_zinc_cycle56_full.sh
blob: 151a51eef4e5b7048a80e334699b2303808670a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "${ROOT_DIR}"
export PYTHONPATH="${ROOT_DIR}:${PYTHONPATH:-}"

DEVICE="${DEVICE:-cuda:0}"
EPOCHS="${EPOCHS:-200}"
SEED="${SEED:-0}"
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 t="$2"
  local ns="$3"
  local view_tag=""
  if [[ "${view}" != "gin" ]]; then
    view_tag="_${view}"
  fi
  echo "runs/rec_rrog${view_tag}_full_sig0.0_K1_none_T${t}_ns${ns}_trace_s${SEED}.json"
}

run_cell() {
  local view="$1"
  local compute="$2"
  local t="$3"
  local ns="$4"
  local out
  out="$(result_path "${view}" "${t}" "${ns}")"
  if [[ -f "${out}" ]]; then
    echo "[skip] ${out}"
    return
  fi
  echo "[run] zinc-cycle56 view=${view} compute=${compute} T=${t} ns=${ns} device=${DEVICE}"
  python3 -m rrog.cli run \
    --task zinc-cycle56 \
    --view "${view}" \
    --compute "${compute}" \
    --epochs "${EPOCHS}" \
    --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 1 3
done

python3 -m rrog.cli zinc-results --epochs "${EPOCHS}"