File size: 946 Bytes
d61c939
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env bash
# Local-to-global interpretability case study with the atom-attentive checkpoint
# (paper App. A6.4). Produces report.json and local_binding.{png,pdf} per target.
# Usage: bash scripts/interpret.sh <atomattn_checkpoint.pt> <output_dir> [targets]
set -euo pipefail

ckpt="$1"
out_dir="$2"
targets="${3:-thrb}"

REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
source "${REPO_DIR}/scripts/variant_config.sh" atom
DATA_ROOT="${TEST_DATA_ROOT:-${REPO_DIR}/test_datasets}"
export PYTHONPATH="${REPO_DIR}:${PYTHONPATH:-}"

python "${REPO_DIR}/tools/interpret_local_binding.py" "${DATA_ROOT}" \
    --user-dir "${REPO_DIR}/unimol" \
    --task test_task \
    --loss three_hybrid_loss \
    --arch ${arch} \
    ${model_flags} \
    --max-pocket-atoms 511 \
    --batch-size 1 \
    --num-workers 0 \
    --seed 1 \
    --fp16 \
    --device-id 0 \
    --path "${ckpt}" \
    --case-targets "${targets}" \
    --case-output "${out_dir}"