Skip to content

Commit

Permalink
Merge pull request #15 from MilkshakeForReal/doc
Browse files Browse the repository at this point in the history
Doc
  • Loading branch information
YichengDWu authored Jun 24, 2022
2 parents f200a51 + af99005 commit 627e91c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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

0 comments on commit 627e91c

Please sign in to comment.