Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revisit FeaturedGraph implementation #215

Closed
wants to merge 15 commits into from
13 changes: 6 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,38 @@ version = "0.7.6"

[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
GraphLaplacians = "a1251efa-393a-423f-9d7b-faaecba535dc"
GraphMLDatasets = "21828b05-d3b3-40ad-870e-a4bc2f52d5e8"
GraphSignals = "3ebe565e-a4b5-49c6-aed2-300248c3a9c1"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
NNlibCUDA = "a00861dc-f156-4864-bf3c-e6376f28a68d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
CUDA = "3.3"
DataStructures = "0.18"
FillArrays = "0.11, 0.12"
Flux = "0.12"
GraphLaplacians = "0.1"
GraphMLDatasets = "0.1"
GraphSignals = "0.2"
KrylovKit = "0.5"
LightGraphs = "1.3"
NNlib = "0.7"
NNlibCUDA = "0.1"
Reexport = "1.1"
Zygote = "0.6"
julia = "1.6"

[extras]
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["SparseArrays", "Test"]
test = ["SparseArrays", "Test", "Zygote"]
6 changes: 4 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ makedocs(
["Message passing scheme" => "abstractions/msgpass.md",
"Graph network block" => "abstractions/gn.md"],
"Manual" =>
["Convolutional Layers" => "manual/conv.md",
[
"Graphs" => "manual/featuredgraph.md",
"Convolutional Layers" => "manual/conv.md",
"Pooling Layers" => "manual/pool.md",
"Models" => "manual/models.md",
"Linear Algebra" => "manual/linalg.md"]
]
]
)

Expand Down
20 changes: 20 additions & 0 deletions docs/src/manual/featuredgraph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Graphs

GeometricFlux relies on the [`FeaturedGraph`](@ref)
type to represent graph structures and feature arrays associated to
nodes and edges.


```@docs
GeometrixFlux.FeaturedGraph
GeometrixFlux.edge_index
GeometrixFlux.graph
GeometrixFlux.adjacency_list
GeometrixFlux.adjacency_matrix
GeometrixFlux.add_self_loops
GeometrixFlux.remove_self_loops
GeometrixFlux.degree
GeometrixFlux.laplacian_matrix
GeometrixFlux.normalized_laplacian
GeometrixFlux.scaled_laplacian
```
22 changes: 0 additions & 22 deletions docs/src/manual/linalg.md
Original file line number Diff line number Diff line change
@@ -1,22 +0,0 @@
# Linear Algebra


```@docs
GraphSignals.degrees
```

```@docs
GraphSignals.degree_matrix
```

```@docs
GraphSignals.inv_sqrt_degree_matrix
```

```@docs
GraphSignals.laplacian_matrix
```

```@docs
GraphSignals.normalized_laplacian
```
30 changes: 22 additions & 8 deletions src/GeometricFlux.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
module GeometricFlux

using NNlib: similar
using LinearAlgebra: similar, fill!
using Statistics: mean
using LinearAlgebra: Adjoint, norm, Transpose
using Reexport

using LinearAlgebra
using SparseArrays
import KrylovKit
using CUDA
using FillArrays: Fill
using Flux
using Flux: glorot_uniform, leakyrelu, GRUCell, @functor
using NNlib, NNlibCUDA
using GraphLaplacians
@reexport using GraphSignals
using LightGraphs
using Zygote
using ChainRulesCore
import LightGraphs
using LightGraphs: AbstractGraph, outneighbors, inneighbors, is_directed, ne, nv,
adjacency_matrix, degree

export
# featured_graph
FeaturedGraph,
graph, edge_index,
node_feature, edge_feature, global_feature,
adjacency_list, normalized_laplacian, scaled_laplacian,
add_self_loops,

# from LightGraphs
adjacency_matrix,

# layers/gn
GraphNet,

Expand Down Expand Up @@ -50,8 +62,10 @@ export
# utils
generate_cluster


include("featuredgraph.jl")
include("graph_conversions.jl")
include("datasets.jl")

include("utils.jl")

include("layers/gn.jl")
Expand Down
Loading