From 16a93628a4513725f70b85ec03ca08e63360fea8 Mon Sep 17 00:00:00 2001 From: Carlo Lucibello Date: Sun, 31 Oct 2021 01:54:26 +0200 Subject: [PATCH] fix docs --- docs/make.jl | 4 +++- docs/src/api/gnngraph.md | 44 ++++++++++++++++---------------------- docs/src/gnngraph.md | 2 +- src/GraphNeuralNetworks.jl | 2 ++ src/utils.jl | 2 +- 5 files changed, 25 insertions(+), 29 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 038ab6f8a..53881728e 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,9 @@ using Flux, NNlib, GraphNeuralNetworks, Graphs, SparseArrays using Documenter -DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup, :(using GraphNeuralNetworks); recursive=true) +DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup, + :(using GraphNeuralNetworks, Graphs, SparseArrays, NNlib, Flux); + recursive=true) makedocs(; modules=[GraphNeuralNetworks, NNlib, Flux, Graphs, SparseArrays], diff --git a/docs/src/api/gnngraph.md b/docs/src/api/gnngraph.md index f4011b50f..0483c1f78 100644 --- a/docs/src/api/gnngraph.md +++ b/docs/src/api/gnngraph.md @@ -4,7 +4,12 @@ CurrentModule = GraphNeuralNetworks # GNNGraph -Documentation page for the graph type `GNNGraph` provided GraphNeuralNetworks.jl and its related methods. +Documentation page for the graph type `GNNGraph` provided by GraphNeuralNetworks.jl and related methods. + +```@contents +Pages = ["gnngraph.md"] +Depth = 5 +``` Besides the methods documented here, one can rely on the large set of functionalities given by [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) @@ -17,21 +22,19 @@ Order = [:type, :function] Pages = ["gnngraph.md"] ``` -## Docs - -### GNNGraph +## GNNGraph type ```@autodocs -Modules = [GraphNeuralNetworks] -Pages = ["GNNGraphs/gnngraph.jl"] +Modules = [GraphNeuralNetworks.GNNGraphs] +Pages = ["gnngraph.jl"] Private = false ``` -### Query +## Query ```@autodocs -Modules = [GraphNeuralNetworks] -Pages = ["GNNGraphs/query.jl"] +Modules = [GraphNeuralNetworks.GNNGraphs] +Pages = ["query.jl"] Private = false ``` @@ -42,29 +45,18 @@ Graphs.outneighbors Graphs.inneighbors ``` -### Transform +## Transform ```@autodocs -Modules = [GraphNeuralNetworks] -Pages = ["GNNGraphs/transform.jl"] +Modules = [GraphNeuralNetworks.GNNGraphs] +Pages = ["transform.jl"] Private = false ``` -```@docs -Flux.batch -SparseArrays.blockdiag -``` - -### Generate +## Generate ```@autodocs -Modules = [GraphNeuralNetworks] -Pages = ["GNNGraphs/generate.jl"] +Modules = [GraphNeuralNetworks.GNNGraphs] +Pages = ["generate.jl"] Private = false ``` - -### Related methods - -```@docs -SparseArrays.sparse -``` diff --git a/docs/src/gnngraph.md b/docs/src/gnngraph.md index 5642af603..c1bfc2d80 100644 --- a/docs/src/gnngraph.md +++ b/docs/src/gnngraph.md @@ -36,7 +36,7 @@ target = [2,3,1,3,1,2,4,3] g = GNNGraph(source, target) ``` -See also the related methods [`adjacency_matrix`](@ref), [`edge_index`](@ref), and [`adjacency_list`](@ref). +See also the related methods [`Graphs.adjacency_matrix`](@ref), [`edge_index`](@ref), and [`adjacency_list`](@ref). ## Basic Queries diff --git a/src/GraphNeuralNetworks.jl b/src/GraphNeuralNetworks.jl index 61c65acd0..f9c19c85f 100644 --- a/src/GraphNeuralNetworks.jl +++ b/src/GraphNeuralNetworks.jl @@ -12,6 +12,8 @@ using NNlib: scatter, gather using ChainRulesCore using Reexport +using SparseArrays, Graphs # not needed but if removed Documenter will complain + include("GNNGraphs/GNNGraphs.jl") @reexport using .GNNGraphs using .GNNGraphs: COO_T, ADJMAT_T, SPARSE_T, diff --git a/src/utils.jl b/src/utils.jl index f7efea14c..c5b4ec698 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -121,7 +121,7 @@ Softmax over each node's neighborhood of the edge features `e`. ```math \mathbf{e}'_{j\to i} = \frac{e^{\mathbf{e}_{j\to i}}} - {\sum_{j'\in N(i)} e^{\mathbf{e}_{j\to i}}}. + {\sum_{j'\in N(i)} e^{\mathbf{e}_{j'\to i}}}. ``` """ function softmax_edge_neighbors(g::GNNGraph, e)