HomeAI & Machine LearningGraph Attention Network: Attention Matrix View

Graph Attention Network: Attention Matrix View

Interactive 2D graph attention network: watch a GAT layer compute LeakyReLU attention scores and softmax-normalize them per neighborhood, rendered as a live spring-embedded node graph plus an N×N attention-weight heatmap.

AI & Machine Learning2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-graph-attention-network-node-classification ↗ Open standalone

This simulator runs a real Graph Attention Network (GAT) layer over a 24-node graph, rendered entirely in 2D. Each node carries a feature vector drawn from one of three class centers; a directed k-nearest-neighbor graph connects it to its most feature-similar peers, and a 2D force (spring) layout — not a flattened 3D projection — spreads the nodes across the canvas. On every parameter change the layer computes LeakyReLU attention scores for each edge, softmax-normalizes them per neighborhood exactly as in the GAT paper, aggregates neighbor features into a new representation, and classifies each node with a linear readout. A second panel renders the full N×N attention-weight matrix as a heatmap — a genuinely 2D-native way to see every node's attention distribution at once, something a single-node 3D inspector can't show. Click any node or matrix row to see the raw attention weights it places on its own neighbors and how concentrated (low-entropy) or diffuse (high-entropy) that attention is.

⚙ Under the hood

Interactive 2D Graph Attention Network: watch a GAT layer compute LeakyReLU attention scores and softmax-normalize them per neighborhood, rendered as a 2D spring-embedded node graph plus a live N×N attention-weight heatmap.

graph neural networkattention mechanismnode classificationGATsoftmaxmachine learningattention matrixforce-directed layout

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)