You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where the coefficients ``\alpha_i`` are given by a [`GNNLib.softmax_nodes`](https://juliagraphs.org/GraphNeuralNetworks.jl/docs/GNNlib.jl/stable/api/utils/#GNNlib.softmax_nodes)
55
+
operation:
56
+
57
+
```math
58
+
\alpha_i = \frac{e^{f_{gate}(\mathbf{x}_i)}}
59
+
{\sum_{i'\in V} e^{f_{gate}(\mathbf{x}_{i'})}}.
60
+
```
61
+
62
+
# Arguments
63
+
64
+
- `fgate`: The function ``f_{gate}: \mathbb{R}^{D_{in}} \to \mathbb{R}``.
65
+
It is typically expressed by a neural network.
66
+
67
+
- `ffeat`: The function ``f_{feat}: \mathbb{R}^{D_{in}} \to \mathbb{R}^{D_{out}}``.
68
+
It is typically expressed by a neural network.
69
+
70
+
# Examples
71
+
72
+
```julia
73
+
using Graphs, LuxCore, Lux, GNNLux, Random
74
+
75
+
rng = Random.default_rng()
76
+
chin = 6
77
+
chout = 5
78
+
79
+
fgate = Dense(chin, 1)
80
+
ffeat = Dense(chin, chout)
81
+
pool = GlobalAttentionPool(fgate, ffeat)
82
+
83
+
g = batch([GNNGraph(Graphs.random_regular_graph(10, 4),
0 commit comments