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

New documentation using MultiDocumenter.jl #492

Closed
wants to merge 25 commits into from
Closed
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
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ Manifest.toml
LocalPreferences.toml
.DS_Store
docs/src/democards/gridtheme.css
test.jl
test.jl
/GNNGraphs/docs/build/
/GNNlib/docs/build/
/GNNLux/docs/build/
/multidocs/build/
/tutorials/docs/build/
6 changes: 6 additions & 0 deletions GNNGraphs/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
37 changes: 37 additions & 0 deletions GNNGraphs/docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Documenter
using DocumenterInterLinks
using GNNGraphs
using Graphs

assets=[]
prettyurls = get(ENV, "CI", nothing) == "true"
mathengine = MathJax3()

interlinks = InterLinks(
"GraphNeuralNetworks" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/graphneuralnetworks/", joinpath(dirname(dirname(@__DIR__)), "docs", "build", "objects.inv")),

)

makedocs(;
modules = [GNNGraphs],
doctest = false,
clean = true,
plugins = [interlinks],
format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing),
sitename = "GNNGraphs.jl",
pages = ["Home" => "index.md",
"Graphs" => ["gnngraph.md", "heterograph.md", "temporalgraph.md"],
"Datasets" => "datasets.md",
"API Reference" => [
"GNNGraph" => "api/gnngraph.md",
"GNNHeteroGraph" => "api/heterograph.md",
"TemporalSnapshotsGNNGraph" => "api/temporalgraph.md",
],
]
)




deploydocs(;repo = "https://github.com/CarloLucibello/GraphNeuralNetworks.jl.git",
dirname = "GNNGraphs")
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CurrentModule = GNNGraphs

# GNNGraph

Documentation page for the graph type `GNNGraph` provided by GraphNeuralNetworks.jl and related methods.
Documentation page for the graph type `GNNGraph` provided by GNNGraphs.jl and related methods.

Besides the methods documented here, one can rely on the large set of functionalities
given by [Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) thanks to the fact
Expand Down
17 changes: 17 additions & 0 deletions GNNGraphs/docs/src/api/heterograph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Heterogeneous Graphs


## GNNHeteroGraph
Documentation page for the type `GNNHeteroGraph` representing heterogeneous graphs, where nodes and edges can have different types.


```@autodocs
Modules = [GNNGraphs]
Pages = ["gnnheterograph.jl"]
Private = false
```

```@docs
Graphs.has_edge(::GNNHeteroGraph, ::Tuple{Symbol, Symbol, Symbol}, ::Integer, ::Integer)
```

File renamed without changes.
10 changes: 10 additions & 0 deletions GNNGraphs/docs/src/datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Datasets

GNNGraphs.jl doesn't come with its own datasets, but leverages those available in the Julia (and non-Julia) ecosystem. In particular, the [examples in the GraphNeuralNetworks.jl repository](https://github.com/CarloLucibello/GraphNeuralNetworks.jl/tree/master/examples) make use of the [MLDatasets.jl](https://github.com/JuliaML/MLDatasets.jl) package. There you will find common graph datasets such as Cora, PubMed, Citeseer, TUDataset and [many others](https://juliaml.github.io/MLDatasets.jl/dev/datasets/graphs/).
For graphs with static structures and temporal features, datasets such as METRLA, PEMSBAY, ChickenPox, and WindMillEnergy are available. For graphs featuring both temporal structures and temporal features, the TemporalBrains dataset is suitable.

GraphNeuralNetworks.jl provides the [`mldataset2gnngraph`](@ref) method for interfacing with MLDatasets.jl.

```@docs
mldataset2gnngraph
```
8 changes: 4 additions & 4 deletions docs/src/gnngraph.md → GNNGraphs/docs/src/gnngraph.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Working with GNNGraph
# Static Graphs

The fundamental graph type in GraphNeuralNetworks.jl is the [`GNNGraph`](@ref).
The fundamental graph type in GNNGraphs.jl is the [`GNNGraph`](@ref).
A GNNGraph `g` is a directed graph with nodes labeled from 1 to `g.num_nodes`.
The underlying implementation allows for efficient application of graph neural network
operators, gpu movement, and storage of node/edge/graph related feature arrays.
Expand All @@ -12,7 +12,7 @@ therefore it supports most functionality from that library.
A GNNGraph can be created from several different data sources encoding the graph topology:

```julia
using GraphNeuralNetworks, Graphs, SparseArrays
using GNNGraphs, Graphs, SparseArrays


# Construct a GNNGraph from from a Graphs.jl's graph
Expand Down Expand Up @@ -233,7 +233,7 @@ Moreover, a `GNNGraph` can be easily constructed from a `Graphs.Graph` or a `Gra
```julia
julia> import Graphs

julia> using GraphNeuralNetworks
julia> using GNNGraphs

# A Graphs.jl undirected graph
julia> gu = Graphs.erdos_renyi(10, 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Relations such as `:rate` or `:like` can connect nodes of different types. We ca

Different node/edge types can store different groups of features
and this makes heterographs a very flexible modeling tools
and data containers. In GraphNeuralNetworks.jl heterographs are implemented in
and data containers. In GNNGraphs.jl heterographs are implemented in
the type [`GNNHeteroGraph`](@ref).


Expand Down
15 changes: 15 additions & 0 deletions GNNGraphs/docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GNNGraphs.jl

GNNGraphs.jl is a package that provides graph data structures and helper functions specifically designed for working with graph neural networks. This package allows to store not only the graph structure, but also features associated with nodes, edges, and the graph itself. It is the core foundation for the GNNlib, GraphNeuralNetworks, and GNNLux packages.

It supports three types of graphs:

- **Static graph** is the basic graph type represented by [`GNNGraph`](@ref), where each node and edge can have associated features. This type of graph is used in typical graph neural network applications, where neural networks operate on both the structure of the graph and the features stored in it. It can be used to represent a graph where the structure does not change over time, but the features of the nodes and edges can change over time.

- **Heterogeneous graph** is a graph that supports multiple types of nodes and edges, and is represented by [`GNNHeteroGraph`](@ref). Each type can have its own properties and relationships. This is useful in scenarios with different entities and interactions, such as in citation graphs or multi-relational data.

- **Temporal graph** is a graph that changes over time, and is represented by [`TemporalSnapshotsGNNGraph`](@ref). Edges and features can change dynamically. This type of graph is useful for applications that involve tracking time-dependent relationships, such as social networks.



This package depends on the package [Graphs.jl] (https://github.com/JuliaGraphs/Graphs.jl).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Temporal Graphs

Temporal Graphs are graphs with time varying topologies and node features. In GraphNeuralNetworks.jl temporal graphs with fixed number of nodes over time are supported by the [`TemporalSnapshotsGNNGraph`](@ref) type.
Temporal Graphs are graphs with time varying topologies and features. In GNNGraphs.jl, temporal graphs with fixed number of nodes over time are supported by the [`TemporalSnapshotsGNNGraph`](@ref) type.

## Creating a TemporalSnapshotsGNNGraph

Expand Down Expand Up @@ -124,10 +124,10 @@ Vector{Matrix{Float64}}

## Graph convolutions on TemporalSnapshotsGNNGraph

A graph convolutional layer can be applied to each snapshot independently, in the next example we apply a `GINConv` layer to each snapshot of a `TemporalSnapshotsGNNGraph`. The list of compatible graph convolution layers can be found [here](api/conv.md).
A graph convolutional layer can be applied to each snapshot independently, in the next example we apply a [`GINConv`](@ref) layer to each snapshot of a `TemporalSnapshotsGNNGraph`.

```jldoctest
julia> using GraphNeuralNetworks, Flux
julia> using GNNGraphs, Flux

julia> snapshots = [rand_graph(10, 20; ndata = rand(3, 10)), rand_graph(10, 14; ndata = rand(3, 10))];

Expand Down
2 changes: 1 addition & 1 deletion GNNGraphs/src/gnngraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ functionality from that library.
# Examples

```julia
using GraphNeuralNetworks
using GNNGraphs, Graphs

# Construct from adjacency list representation
data = [[2,3], [1,4,5], [1], [2,5], [2,4]]
Expand Down
2 changes: 1 addition & 1 deletion GNNGraphs/src/gnnheterograph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ It is similar to [`GNNGraph`](@ref) but nodes and edges are of different types.
# Examples

```julia
julia> using GraphNeuralNetworks
julia> using GNNGraphs

julia> nA, nB = 10, 20;

Expand Down
4 changes: 2 additions & 2 deletions GNNGraphs/src/mldatasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Convert a graph dataset from the package MLDatasets.jl into one or many [`GNNGra

# Examples

```jldoctest
julia> using MLDatasets, GraphNeuralNetworks
```julia
julia> using MLDatasets, GNNGraphs

julia> mldataset2gnngraph(Cora())
GNNGraph:
Expand Down
6 changes: 3 additions & 3 deletions GNNGraphs/src/temporalsnapshotsgnngraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The features can be passed at construction time or added later.
# Examples

```julia
julia> using GraphNeuralNetworks
julia> using GNNGraphs

julia> snapshots = [rand_graph(10,20) for i in 1:5];

Expand Down Expand Up @@ -78,7 +78,7 @@ Return a `TemporalSnapshotsGNNGraph` created starting from `tg` by adding the sn
# Examples

```jldoctest
julia> using GraphNeuralNetworks
julia> using GNNGraphs

julia> snapshots = [rand_graph(10, 20) for i in 1:5];

Expand Down Expand Up @@ -138,7 +138,7 @@ Return a [`TemporalSnapshotsGNNGraph`](@ref) created starting from `tg` by remov
# Examples

```jldoctest
julia> using GraphNeuralNetworks
julia> using GNNGraphs

julia> snapshots = [rand_graph(10,20), rand_graph(10,14), rand_graph(10,22)];

Expand Down
4 changes: 2 additions & 2 deletions GNNGraphs/src/transform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ A new GNNGraph with the specified edges removed.

# Example
```julia
julia> using GraphNeuralNetworks
julia> using GNNGraphs

# Construct a GNNGraph
julia> g = GNNGraph([1, 1, 2, 2, 3], [2, 3, 1, 3, 1])
Expand Down Expand Up @@ -275,7 +275,7 @@ A new GNNGraph with the specified nodes and all edges associated with these node

# Example
```julia
using GraphNeuralNetworks
using GNNGraphs

g = GNNGraph([1, 1, 2, 2, 3], [2, 3, 1, 3, 1])

Expand Down
5 changes: 5 additions & 0 deletions GNNLux/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GNNLux = "e8545f4d-a905-48ac-a8c4-ca114b98986d"
GNNlib = "a6a84749-d869-43f8-aacc-be26a1996e48"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
26 changes: 26 additions & 0 deletions GNNLux/docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Documenter
using GNNlib
using GNNLux



assets=[]
prettyurls = get(ENV, "CI", nothing) == "true"
mathengine = MathJax3()


makedocs(;
modules = [GNNLux],
doctest = false,
clean = true,
format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing),
sitename = "GNNLux.jl",
pages = ["Home" => "index.md",
"Basic" => "api/basic.md"],
)




deploydocs(;repo = "https://github.com/CarloLucibello/GraphNeuralNetworks.jl.git",
dirname = "GNNLux")
8 changes: 8 additions & 0 deletions GNNLux/docs/src/api/basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```@meta
CurrentModule = GNNLux
```

## GNNLayer
```@docs
GNNLux.GNNLayer
```
5 changes: 5 additions & 0 deletions GNNLux/docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# GNNLux.jl

GNNLux.jl is a work-in-progress package that implements stateless graph convolutional layers, fully compatible with the [Lux.jl](https://lux.csail.mit.edu/stable/) machine learning framework. It is built on top of the GNNGraphs.jl, GNNlib.jl, and Lux.jl packages.

The full documentation will be available soon.
4 changes: 2 additions & 2 deletions GNNLux/src/layers/basic.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#See also [`GNNChain`](@ref GNNLux.GNNChain).

"""
abstract type GNNLayer <: AbstractLuxLayer end

An abstract type from which graph neural network layers are derived.
It is Derived from Lux's `AbstractLuxLayer` type.

See also [`GNNChain`](@ref GNNLux.GNNChain).
"""
abstract type GNNLayer <: AbstractLuxLayer end

Expand Down
6 changes: 6 additions & 0 deletions GNNlib/docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
GNNGraphs = "aed8fd31-079b-4b5a-b342-a13352159b8c"
GNNlib = "a6a84749-d869-43f8-aacc-be26a1996e48"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
41 changes: 41 additions & 0 deletions GNNlib/docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Documenter
using GNNlib
using GNNGraphs
using DocumenterInterLinks


assets=[]
prettyurls = get(ENV, "CI", nothing) == "true"
mathengine = MathJax3()

interlinks = InterLinks(
"NNlib" => "https://fluxml.ai/NNlib.jl/stable/",
"GNNGraphs" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/gnngraphs/", joinpath(dirname(dirname(@__DIR__)), "GNNGraphs", "docs", "build", "objects.inv")),
"GraphNeuralNetworks" => ("https://carlolucibello.github.io/GraphNeuralNetworks.jl/graphneuralnetworks/", joinpath(dirname(dirname(@__DIR__)), "docs", "build", "objects.inv")),)


makedocs(;
modules = [GNNlib],
doctest = false,
clean = true,
plugins = [interlinks],
format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing),
sitename = "GNNlib.jl",
pages = ["Home" => "index.md",
"Message Passing" => "messagepassing.md",

"API Reference" => [

"Message Passing" => "api/messagepassing.md",

"Utils" => "api/utils.md",
]

]
)




deploydocs(;repo = "https://github.com/CarloLucibello/GraphNeuralNetworks.jl.git",
dirname = "GNNlib")
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = GraphNeuralNetworks
CurrentModule = GNNlib
```

# Message Passing
Expand Down
16 changes: 8 additions & 8 deletions docs/src/api/utils.md → GNNlib/docs/src/api/utils.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```@meta
CurrentModule = GraphNeuralNetworks
CurrentModule = GNNlib
```

# Utility Functions
Expand All @@ -17,18 +17,18 @@ Pages = ["utils.md"]
### Graph-wise operations

```@docs
GraphNeuralNetworks.reduce_nodes
GraphNeuralNetworks.reduce_edges
GraphNeuralNetworks.softmax_nodes
GraphNeuralNetworks.softmax_edges
GraphNeuralNetworks.broadcast_nodes
GraphNeuralNetworks.broadcast_edges
reduce_nodes
reduce_edges
softmax_nodes
softmax_edges
broadcast_nodes
broadcast_edges
```

### Neighborhood operations

```@docs
GraphNeuralNetworks.softmax_edge_neighbors
softmax_edge_neighbors
```

### NNlib
Expand Down
Loading
Loading