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

Doc #15

Merged
merged 3 commits into from
Jun 24, 2022
Merged

Doc #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/layers.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@doc doc """
@doc raw"""
AbstractGNNLayer <: AbstractExplicitLayer
An abstract type of graph neural networks. See also [`AbstractGNNContainerLayer`](@ref)
"""
abstract type AbstractGNNLayer <: AbstractExplicitLayer end

@doc doc"""
@doc raw"""
AbstractGNNContainerLayer <: AbstractExplicitContainerLayer

This is an abstract type of GNN layers that contains other layers.
Expand All @@ -26,12 +26,14 @@ function statelength(l::AbstractGNNContainerLayer{layers}) where {layers}
return sum(statelength, getfield.((l,), layers)) + 1
end

@doc doc"""
@doc raw"""
ExplicitEdgeConv(ϕ; initialgraph = initialgraph, aggr = mean)

Edge convolutional layer from [Learning continuous-time PDEs from sparse data with graph neural networks](https://arxiv.org/abs/2006.08956).

``\mathbf{u}_i' = \square_{j \in N(i)}\, \phi([\mathbf{u}_i, \mathbf{u}_j; \mathbf{x}_j - \mathbf{x}_i])``
```math
\mathbf{u}_i' = \square_{j \in N(i)}\, \phi([\mathbf{u}_i, \mathbf{u}_j; \mathbf{x}_j - \mathbf{x}_i])
```

## Arguments

Expand Down Expand Up @@ -71,7 +73,7 @@ ps, st = Lux.setup(rng, l)

```

@doc doc"""
@doc raw"""
struct ExplicitEdgeConv{F, M <: AbstractExplicitLayer} <:
AbstractGNNContainerLayer{(:ϕ,)}
initialgraph::F
Expand Down Expand Up @@ -103,7 +105,7 @@ function (l::ExplicitEdgeConv)(x::NamedTuple, ps, st::NamedTuple)
return propagate(message, g, l.aggr, xi = xs, xj = xs), st
end

@doc doc"""
@doc raw"""
ExplicitGCNConv(in_chs::Int, out_chs::Int, activation = identity;
initialgraph = initialgraph, init_weight = glorot_normal,
init_bias = zeros32)
Expand Down
4 changes: 2 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Create a shollow copy of the input graph `g`. This is equivalent to `GNNGraph(g)
"""
copy(g::GNNGraph) = GNNGraph(g)

@doc doc"""
@doc raw"""
wrapgraph(g::GNNGraph) = () -> copy(g)
wrapgraph(f::Function) = f

Expand All @@ -18,7 +18,7 @@ Creater a function wrapper of the input graph.
wrapgraph(g::GNNGraph) = () -> copy(g)
wrapgraph(f::Function) = f

@doc doc"""
@doc raw"""
updategraph(st, g) -> st
Recursively replace the value of `graph` with a shallow copy of `g`.
"""
Expand Down