Skip to content

Commit 305b16c

Browse files
author
Daniele Solombrino
committed
fix GAT theory question
1 parent a24ebc3 commit 305b16c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Theory/AML_theory.ipynb

+2-6
Original file line numberDiff line numberDiff line change
@@ -1341,13 +1341,9 @@
13411341
"#### Bonus Question (1 Point)\n",
13421342
"*Q: Compared to the Transformer Network, why doesn't the GAT also have Key, Query and Value?*\n",
13431343
"\n",
1344-
"*A: In Graph Attention Networks (GAT), a variation of the attention mechanism is used that doesn't explicitly employ separate key, query, and value vectors as in traditional self-attention mechanisms like those found in the Transformer model. Instead, GAT directly computes attention coefficients (attention scores) based on the node embeddings. In GATs, each node in the graph has an associated learnable parameter vector **$a$** for the node itself (called a \"self-attention\" mechanism) and for its neighbors. The attention mechanism computes attention scores between a node and its neighbors based on the dot product of the node's embeddings and the neighbor nodes' embeddings. These attention scores are then used to compute a weighted sum of the neighbor nodes' values, which is used to update the node's representation.\n",
1344+
"The presented Graph Attention Networks (GAT) version uses **additive** attention, which does not use the query, key and value roles, hence it does not need their linear transformations.\n",
13451345
"\n",
1346-
"The attention mechanism in GATs is typically defined as follows:\n",
1347-
"\n",
1348-
"​$Attention(h_{i},h_{j}) = \\frac{\\sum_{k \\in N(i)} \\exp({\\text{LeakyReLU}(a^{T}[W h_i, W h_j])})}{\\exp({\\text{LeakyReLU}(a^{T}[W h_i, W h_j])})}$\n",
1349-
"\n",
1350-
"Here, $h_{i}$​ and $h_{j}$ are the node representations, $N_{i}$​ is the set of neighbors of node i, aa is a learnable parameter vector, W is a learnable weight matrix.\n"
1346+
"Query, key and values have been proposed in dot-product-based attention, which came after this additive attention."
13511347
]
13521348
},
13531349
{

0 commit comments

Comments
 (0)