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
grad = Zygote.gradient(ps ->mean(model(g, X, ps, st)[1]), ps)[1]
65
+
```
66
+
67
+
## Implicit modeling with GNNChains
68
+
69
+
While very flexible, the way in which we defined `GNN` model definition in last section is a bit verbose.
70
+
In order to simplify things, we provide the [`GNNLux.GNNChain`](@ref) type. It is very similar
71
+
to Lux's well known `Chain`. It allows to compose layers in a sequential fashion as Chain
72
+
does, propagating the output of each layer to the next one. In addition, `GNNChain`
73
+
propagates the input graph as well, providing it as a first argument
74
+
to layers subtyping the [`GNNLux.GNNLayer`](@ref) abstract type.
75
+
76
+
Using `GNNChain`, the model definition becomes more concise:
77
+
78
+
```julia
79
+
model =GNNChain(GraphConv(din => d),
80
+
BatchNorm(d),
81
+
x ->relu.(x),
82
+
GraphConv(d => d, relu),
83
+
Dropout(0.5),
84
+
Dense(d, dout))
85
+
```
86
+
87
+
The `GNNChain` only propagates the graph and the node features. More complex scenarios, e.g. when also edge features are updated, have to be handled using the explicit definition of the forward pass.
Copy file name to clipboardExpand all lines: GNNLux/docs/src/index.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,23 @@
1
1
# GNNLux.jl
2
2
3
-
GNNLux.jl is a work-in-progress package that implements stateless graph convolutional layers, fully compatible with the [Lux.jl](https://lux.csail.mit.edu/stable/) machine learning framework. It is built on top of the GNNGraphs.jl, GNNlib.jl, and Lux.jl packages.
3
+
GNNLux.jl is a package that implements graph convolutional layers fully compatible with the [Lux.jl](https://lux.csail.mit.edu/stable/) deep learning framework. It is built on top of the GNNGraphs.jl, GNNlib.jl, and Lux.jl packages.
4
+
5
+
See [GraphNeuralNetworks.jl](https://juliagraphs.org/GraphNeuralNetworks.jl/graphneuralnetworks/) instead for a
6
+
[Flux.jl](https://fluxml.ai/Flux.jl/stable/)-based implementation of graph neural networks.
7
+
8
+
## Installation
9
+
10
+
GNNLux.jl is a registered Julia package. You can easily install it through the package manager :
11
+
12
+
```julia
13
+
pkg> add GNNLux
14
+
```
4
15
5
16
## Package overview
6
17
7
18
Let's give a brief overview of the package by solving a graph regression problem with synthetic data.
8
19
20
+
9
21
### Data preparation
10
22
11
23
We generate a dataset of multiple random graphs with associated data features, then split it into training and testing sets.
0 commit comments