-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvisualize_attention.sh
More file actions
68 lines (57 loc) · 1.76 KB
/
visualize_attention.sh
File metadata and controls
68 lines (57 loc) · 1.76 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# ==========================================
# Attention Visualization Script (PRIME Cross-Attention)
# ==========================================
# -----------------------------
# Config
# -----------------------------
DATA_CONFIG="./config/data_config.yaml"
MODEL_CONFIG="./config/model_config.yaml"
# -----------------------------
# GPU Selection
# -----------------------------
CUDA_DEVICE=0
# -----------------------------
# Settings
# -----------------------------
BATCH_SIZE=32
OUTPUT_DIR="./plots"
# -----------------------------
# Task settings
# FoldClassification | ECReaction | GeneOntology | BindingSite
# -----------------------------
TASK="ECReaction"
GO_BRANCH="MF" # MF | BP | CC — only used for GeneOntology
# -----------------------------
# Hierarchy
# -----------------------------
ACTIVE_LEVELS=("surface" "atom" "residue" "sse" "protein")
echo "===================================="
echo "Visualizing Attention Weights"
echo "Model: PRIME_CrossAttention"
echo "Task: $TASK"
echo "CUDA device: $CUDA_DEVICE"
echo "Batch Size: $BATCH_SIZE"
echo "Active Levels: ${ACTIVE_LEVELS[@]}"
echo "Output dir: $OUTPUT_DIR"
echo "===================================="
# -----------------------------
# Build command
# -----------------------------
CMD="CUDA_VISIBLE_DEVICES=$CUDA_DEVICE python visualize_attention.py \
--data_config $DATA_CONFIG \
--model_config $MODEL_CONFIG \
--task $TASK \
--batch_size $BATCH_SIZE \
--output_dir $OUTPUT_DIR \
--active_levels ${ACTIVE_LEVELS[@]}"
# add go_branch if GeneOntology
if [ "$TASK" == "GeneOntology" ]; then
echo "GO Branch: $GO_BRANCH"
CMD="$CMD --go_branch $GO_BRANCH"
fi
# -----------------------------
# Run
# -----------------------------
eval $CMD
echo "Done."