PaTz โ€” Physics-Aware Transformer with eXplainability
โ— API Offlinepatz_env

Feature Importance โ€” Integrated Gradients

CAPTUM

Per-residue attribution analysis using Axiomatic IG. Implementation: Captum with manual Riemann fallback.

Integrated Gradients
IG_i(x) = (x_i โˆ’ xโ€ฒ_i) ยท โˆซโ‚€ยน โˆ‚F(xโ€ฒ + ฮฑ(xโˆ’xโ€ฒ))/โˆ‚x_i dฮฑ
Approximated via Riemann sum with n_steps=50. Baseline xโ€ฒ = zero vector (uninformative). Axiom completeness: ฮฃ_i IG_i = F(x) โˆ’ F(xโ€ฒ).
Implementation Details
LibraryCaptum 0.6+ (PyTorch-native)
FallbackManual Riemann sum (n_steps=50)
BaselineZero vector xโ€ฒ = 0โ‚โ‚‚โ‚ˆโ‚€
TargetEach predicted GO term independently
Attribution Shape[L, 1280] โ†’ aggregated to [L] by L2 norm
Proteins analyzedโ€”
GO terms per proteinโ€”
Axioms Satisfied
โœ“ Completeness
ฮฃ_i IG_i(x) = F(x) โˆ’ F(xโ€ฒ). The attributions sum to the difference in model output between the input and baseline.
โœ“ Sensitivity
If F(x) โ‰  F(xโ€ฒ) for some feature i where x_i โ‰  xโ€ฒ_i, then IG_i โ‰  0.
โœ“ Implementation Invariance
IG is independent of internal network architecture; computed on the input embedding, not activations.
โœ“ Linearity
IG is linear in the network output: IG(ฮฑFโ‚ + ฮฒFโ‚‚) = ฮฑIG(Fโ‚) + ฮฒIG(Fโ‚‚).
Full residue heatmap visualization

Interactive per-residue attribution heatmaps are available in the XAI Dashboard โ€” select any protein and GO term to view its full attribution map and top-20 influential residues.