diff --git a/docs/Project.toml b/docs/Project.toml index be55060e8..fbb87169f 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,4 +1,5 @@ [deps] +DemoCards = "311a05b2-6137-4a5a-b473-18580a3d38b5" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c" GraphNeuralNetworks = "cffab07f-9bc2-4db1-8861-388f63bf7694" @@ -6,8 +7,10 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MarkdownLiteral = "736d6165-7244-6769-4267-6b50796e6954" NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" -Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781" -PlutoStaticHTML = "359b1769-a58e-495b-9770-312e911026ad" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + + +[compat] +DemoCards = "^0.4.10" diff --git a/docs/make.jl b/docs/make.jl index 3b5e7873c..138910093 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,31 +1,10 @@ using Flux, NNlib, GraphNeuralNetworks, Graphs, SparseArrays -using Documenter +using Documenter, DemoCards -# See this for a template of Pluto+Documenter -# https://github.com/rikhuijzer/PlutoStaticHTML.jl/blob/main/docs/make.jl -using Pluto, PlutoStaticHTML -using Documenter: MathJax3 +tutorials, tutorials_cb, tutorial_assets = makedemos("tutorials") -pluto_src_folder = joinpath(@__DIR__, "src", "tutorials") - -""" - build() - -Run all Pluto notebooks (".jl" files) in `NOTEBOOK_DIR`. -""" -function build() - println("Building notebooks") - hopts = HTMLOptions(; append_build_context=false) - output_format = documenter_output - bopts = BuildOptions(pluto_src_folder; output_format) - build_notebooks(bopts, hopts) - return nothing -end - -# Build the notebooks; defaults to true. -if get(ENV, "BUILD_DOCS_NOTEBOOKS", "true") == "true" - build() -end +assets = [] +isnothing(tutorial_assets) || push!(assets, tutorial_assets) DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup, :(using GraphNeuralNetworks, Graphs, SparseArrays, NNlib, Flux); @@ -38,19 +17,14 @@ makedocs(; modules = [GraphNeuralNetworks, NNlib, Flux, Graphs, SparseArrays], doctest = false, clean = true, - format= Documenter.HTML(; mathengine, prettyurls), + format= Documenter.HTML(; mathengine, prettyurls, assets=assets), sitename = "GraphNeuralNetworks.jl", pages = ["Home" => "index.md", "Graphs" => "gnngraph.md", "Message Passing" => "messagepassing.md", "Model Building" => "models.md", "Datasets" => "datasets.md", - "Tutorials" => - [ - "Intro to Graph Neural Networks" => "tutorials/gnn_intro_pluto.md", - "Graph Classification" => "tutorials/graph_classification_pluto.md", - "Node Classification" => "tutorials/node_classification_pluto.md", - ], + "Tutorials" => tutorials, "API Reference" => [ "GNNGraph" => "api/gnngraph.md", @@ -65,4 +39,6 @@ makedocs(; ], ) +tutorials_cb() + deploydocs(repo="github.com/CarloLucibello/GraphNeuralNetworks.jl.git") diff --git a/docs/src/tutorials/.gitignore b/docs/src/tutorials/.gitignore deleted file mode 100644 index 2e1fa2d52..000000000 --- a/docs/src/tutorials/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.md \ No newline at end of file diff --git a/docs/tutorials/config.json b/docs/tutorials/config.json new file mode 100644 index 000000000..354f981c2 --- /dev/null +++ b/docs/tutorials/config.json @@ -0,0 +1,3 @@ +{ + "theme": "grid" +} diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md new file mode 100644 index 000000000..2e9f1ffa3 --- /dev/null +++ b/docs/tutorials/index.md @@ -0,0 +1,19 @@ +# [Tutorials](@id tutorials) + +--- + +{{{democards}}} + +--- + +## Contributions + +If you have a suggestion on adding new tutorials, feel free to create a new issue +[here](https://github.com/CarloLucibello/GraphNeuralNetworks.jl/issues/new). +Users are invited to contribute demonstrations of their own. +If you want to contribute new tutorials and looking for inspiration, +checkout these tutorials from +[PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/notes/colabs.html). +You are expected to use [Pluto.jl](https://github.com/fonsp/Pluto.jl) notebooks +with [DemoCards.jl](https://github.com/JuliaDocs/DemoCards.jl). +Please check out exsisting tutorials for more details. diff --git a/docs/tutorials/introductory_tutorials/assets/graph_classification.gif b/docs/tutorials/introductory_tutorials/assets/graph_classification.gif new file mode 100644 index 000000000..d80510fc8 Binary files /dev/null and b/docs/tutorials/introductory_tutorials/assets/graph_classification.gif differ diff --git a/docs/tutorials/introductory_tutorials/assets/intro_1.png b/docs/tutorials/introductory_tutorials/assets/intro_1.png new file mode 100644 index 000000000..3bf23ec36 Binary files /dev/null and b/docs/tutorials/introductory_tutorials/assets/intro_1.png differ diff --git a/docs/tutorials/introductory_tutorials/assets/node_classsification.gif b/docs/tutorials/introductory_tutorials/assets/node_classsification.gif new file mode 100644 index 000000000..77b630609 Binary files /dev/null and b/docs/tutorials/introductory_tutorials/assets/node_classsification.gif differ diff --git a/docs/src/tutorials/gnn_intro_pluto.jl b/docs/tutorials/introductory_tutorials/gnn_intro_pluto.jl similarity index 96% rename from docs/src/tutorials/gnn_intro_pluto.jl rename to docs/tutorials/introductory_tutorials/gnn_intro_pluto.jl index b5834a8cb..dfa4ff29b 100644 --- a/docs/src/tutorials/gnn_intro_pluto.jl +++ b/docs/tutorials/introductory_tutorials/gnn_intro_pluto.jl @@ -1,5 +1,5 @@ ### A Pluto.jl notebook ### -# v0.19.5 +# v0.19.11 using Markdown using InteractiveUtils @@ -10,13 +10,13 @@ begin using Pkg Pkg.activate(; temp=true) packages = [ - PackageSpec(; path=joinpath(@__DIR__,"..","..","..")), + PackageSpec(; name="GraphNeuralNetworks", version="0.4"), PackageSpec(; name="Flux", version="0.13"), - PackageSpec(; name="MLDatasets", version="0.7"), - PackageSpec(; name="GraphMakie"), - PackageSpec(; name="Graphs"), - PackageSpec(; name="CairoMakie"), - PackageSpec(; name="PlutoUI"), + PackageSpec(; name="MLDatasets", version="0.7"), + PackageSpec(; name="GraphMakie"), + PackageSpec(; name="Graphs"), + PackageSpec(; name="CairoMakie"), + PackageSpec(; name="PlutoUI"), ] Pkg.add(packages) end @@ -36,10 +36,19 @@ begin Random.seed!(17) # for reproducibility end; -# ╔═╡ 03a9e023-e682-4ea3-a10b-14c4d101b291 +# ╔═╡ cc051aa1-b929-4bca-b261-7f797a644a2b md""" -# Introduction: Hands-on Graph Neural Networks +--- +title: Hands-on introduction to Graph Neural Networks +cover: assets/intro_1.png +author: "[Carlo Lucibello](https://github.com/CarloLucibello)" +date: 2022-05-24 +description: A beginner level introduction to graph machine learning using GraphNeuralNetworks.jl. +--- +""" +# ╔═╡ 03a9e023-e682-4ea3-a10b-14c4d101b291 +md""" *This Pluto notebook is a julia adaptation of the Pytorch Geometric tutorials that can be found [here](https://pytorch-geometric.readthedocs.io/en/latest/notes/colabs.html).* Recently, deep learning on graphs has emerged to one of the hottest research fields in the deep learning community. @@ -330,6 +339,7 @@ Furthermore, we did this all with a few lines of code, thanks to the GraphNeural """ # ╔═╡ Cell order: +# ╟─cc051aa1-b929-4bca-b261-7f797a644a2b # ╟─03a9e023-e682-4ea3-a10b-14c4d101b291 # ╟─6f20e59c-b002-4d22-9ee0-b62596574776 # ╠═361e0948-d91a-11ec-2d95-2db77435a0c1 diff --git a/docs/src/tutorials/graph_classification_pluto.jl b/docs/tutorials/introductory_tutorials/graph_classification_pluto.jl similarity index 95% rename from docs/src/tutorials/graph_classification_pluto.jl rename to docs/tutorials/introductory_tutorials/graph_classification_pluto.jl index f0e0d2591..d6f9779ba 100644 --- a/docs/src/tutorials/graph_classification_pluto.jl +++ b/docs/tutorials/introductory_tutorials/graph_classification_pluto.jl @@ -1,9 +1,5 @@ ### A Pluto.jl notebook ### -# v0.19.6 - -#> [frontmatter] -#> title = "Graph Classification with Graph Neural Networks" -#> date = "2022-05-23" +# v0.19.11 using Markdown using InteractiveUtils @@ -14,10 +10,10 @@ begin using Pkg Pkg.activate(; temp=true) Pkg.add([ - PackageSpec(; path=joinpath(@__DIR__,"..","..","..")), + PackageSpec(; name="GraphNeuralNetworks", version="0.4"), PackageSpec(; name="Flux", version="0.13"), - PackageSpec(; name="MLDatasets", version="0.7"), - PackageSpec(; name="MLUtils"), + PackageSpec(; name="MLDatasets", version="0.7"), + PackageSpec(; name="MLUtils"), ]) Pkg.develop("GraphNeuralNetworks") end @@ -36,10 +32,19 @@ begin Random.seed!(17) # for reproducibility end; -# ╔═╡ 15136fd8-f9b2-4841-9a95-9de7b8969687 +# ╔═╡ c07e1be9-adb6-4454-8128-bc8917406c58 md""" -# Graph Classification with Graph Neural Networks +--- +title: Graph Classification with Graph Neural Networks +cover: assets/graph_classification.gif +author: "[Carlo Lucibello](https://github.com/CarloLucibello)" +date: 2022-05-23 +description: Tutorial for Graph Classification using GraphNeuralNetworks.jl +--- +""" +# ╔═╡ 15136fd8-f9b2-4841-9a95-9de7b8969687 +md""" *This Pluto notebook is a julia adaptation of the Pytorch Geometric tutorials that can be found [here](https://pytorch-geometric.readthedocs.io/en/latest/notes/colabs.html).* In this tutorial session we will have a closer look at how to apply **Graph Neural Networks (GNNs) to the task of graph classification**. @@ -271,9 +276,10 @@ You have learned how graphs can be batched together for better GPU utilization, """ # ╔═╡ Cell order: -# ╠═c97a0002-2253-45b6-9266-017189dbb6fe +# ╟─c07e1be9-adb6-4454-8128-bc8917406c58 +# ╟─cc97a0002-2253-45b6-9266-017189dbb6fe # ╠═361e0948-d91a-11ec-2d95-2db77435a0c1 -# ╟─15136fd8-f9b2-4841-9a95-9de7b8969687 +# ╠═15136fd8-f9b2-4841-9a95-9de7b8969687 # ╠═f6e86958-e96f-4c77-91fc-c72d8967575c # ╠═24f76360-8599-46c8-a49f-4c31f02eb7d8 # ╠═5d5e5152-c860-4158-8bc7-67ee1022f9f8 diff --git a/docs/src/tutorials/node_classification_pluto.jl b/docs/tutorials/introductory_tutorials/node_classification_pluto.jl similarity index 98% rename from docs/src/tutorials/node_classification_pluto.jl rename to docs/tutorials/introductory_tutorials/node_classification_pluto.jl index 9aacc4eda..10f5b17ee 100644 --- a/docs/src/tutorials/node_classification_pluto.jl +++ b/docs/tutorials/introductory_tutorials/node_classification_pluto.jl @@ -10,7 +10,7 @@ begin using Pkg Pkg.activate(; temp=true) packages = [ - PackageSpec(; path=joinpath(@__DIR__,"..","..","..")), + PackageSpec(; name="GraphNeuralNetworks", version="0.4"), PackageSpec(; name="Flux", version="0.13"), PackageSpec(; name="MLDatasets", version="0.7"), PackageSpec(; name="Plots"), @@ -38,7 +38,13 @@ end # ╔═╡ 8db76e69-01ee-42d6-8721-19a3848693ae md""" -# Node Classification +--- +title: Node Classification with Graph Neural Networks +cover: assets/node_classsification.gif +author: "[Deeptendu Santra](https://github.com/Dsantra92)" +date: 2022-09-25 +description: Tutorial for Node classification using GraphNeuralNetworks.jl +--- """ # ╔═╡ ca2f0293-7eac-4d9a-9a2f-fda47fd95a99