Skip to content

Commit 06f0c57

Browse files
update readme
1 parent 0e8a9ca commit 06f0c57

File tree

1 file changed

+2
-55
lines changed

1 file changed

+2
-55
lines changed

README.md

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -21,60 +21,7 @@ Some of its noticeable features are the following:
2121
]add GraphNeuralNetworks
2222
```
2323

24-
## Featured Graphs
24+
## Usage
2525

26-
GraphNeuralNetworks handles graph data (the graph topology + node/edge/global features)
27-
thanks to the type `FeaturedGraph`.
28-
29-
A `FeaturedGraph` can be constructed out of
30-
adjacency matrices, adjacency lists, LightGraphs' types...
31-
32-
```julia
33-
fg = FeaturedGraph(adj_list)
34-
```
35-
36-
## Graph convolutional layers
37-
38-
Construct a GCN layer:
39-
40-
```julia
41-
GCNConv(input_dim => output_dim, relu)
42-
```
43-
44-
## Usage Example
45-
46-
```julia
47-
struct GNN
48-
conv1
49-
conv2
50-
dense
51-
end
52-
53-
@functor GNN
54-
55-
function GNN()
56-
GNN(GCNConv(1024=>512, relu),
57-
GCNConv(512=>128, relu),
58-
Dense(128, 10))
59-
end
60-
61-
function (net::GNN)(g, x)
62-
x = net.conv1(g, x)
63-
x = dropout(x, 0.5)
64-
x = net.conv2(g, x)
65-
x = net.dense(x)
66-
return x
67-
end
68-
69-
model = GNN()
70-
71-
loss(x, y) = logitcrossentropy(model(fg, x), y)
72-
accuracy(x, y) = mean(onecold(model(fg, x)) .== onecold(y))
73-
74-
ps = Flux.params(model)
75-
train_data = [(train_X, train_y)]
76-
opt = ADAM(0.01)
77-
evalcb() = @show(accuracy(train_X, train_y))
78-
79-
Flux.train!(loss, ps, train_data, opt, cb=throttle(evalcb, 10))
26+
Usage examples can be found in the `examples/` folder.
8027
```

0 commit comments

Comments
 (0)