Skip to content
Merged
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
29 changes: 26 additions & 3 deletions docs/tutorial/basic_concepts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@
"source": [
"# Basic pathpyG Concepts\n",
"\n",
"## Prerequisites\n",
"\n",
"First, we need to set up our Python environment that has PyTorch, PyTorch Geometric and PathpyG installed. Depending on where you are executing this notebook, this might already be (partially) done. E.g. Google Colab has PyTorch installed by default so we only need to install the remaining dependencies. The DevContainer that is part of our GitHub Repository on the other hand already has all of the necessary dependencies installed. \n",
"\n",
"In the following, we install the packages for usage in Google Colab using Jupyter magic commands. For other environments comment in or out the commands as necessary. For more details on how to install `pathpyG` especially if you want to install it with GPU-support, we refer to our [documentation](https://www.pathpy.net/dev/getting_started/). Note that `%%capture` discards the full output of the cell to not clutter this tutorial with unnecessary installation details. If you want to print the output, you can comment `%%capture` out."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"# !pip install torch\n",
"!pip install torch_geometric\n",
"!pip install git+https://github.com/pathpy/pathpyG.git"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Motivation and Learning Objectives\n",
"\n",
"This first step of our multi-stage introductory tutorial introduces the key concepts of `pathpyG`. While `pathpyG` targets GPU-accelerated analysis and learning in time series data on temporal graphs, it is also a great tool to represent, analyze and visualize static graphs. For this, it provides a `Graph` class that is implemented based on the `torch_geometric.data.Data` object, which has the advantage that we can directly apply `pyG` transforms and use the underlying data for graph learning tasks.\n",
Expand All @@ -17,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -627,7 +650,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand All @@ -636,7 +659,7 @@
"Data(edge_index=[2, 3], num_nodes=3)"
]
},
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
23 changes: 23 additions & 0 deletions docs/tutorial/dbgnn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@
"source": [
"# Causality-Aware Graph Neural Networks\n",
"\n",
"## Prerequisites\n",
"\n",
"First, we need to set up our Python environment that has PyTorch, PyTorch Geometric and PathpyG installed. Depending on where you are executing this notebook, this might already be (partially) done. E.g. Google Colab has PyTorch installed by default so we only need to install the remaining dependencies. The DevContainer that is part of our GitHub Repository on the other hand already has all of the necessary dependencies installed. \n",
"\n",
"In the following, we install the packages for usage in Google Colab using Jupyter magic commands. For other environments comment in or out the commands as necessary. For more details on how to install `pathpyG` especially if you want to install it with GPU-support, we refer to our [documentation](https://www.pathpy.net/dev/getting_started/). Note that `%%capture` discards the full output of the cell to not clutter this tutorial with unnecessary installation details. If you want to print the output, you can comment `%%capture` out."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"# !pip install torch\n",
"!pip install torch_geometric\n",
"!pip install git+https://github.com/pathpy/pathpyG.git"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Motivation and Learning Objectives\n",
"\n",
"In previous tutorials, we have introduced causal paths in temporal graphs, and how we can use them to generate higher-order De Bruijn graph models that capture temporal-topological patterns in time series data. In this tutorial, we will show how we can use De Bruijn Graph Neural Networks, a causality-aware deep learning architecture for temporal graph data. The details of this approach are introduced [in this paper](https://proceedings.mlr.press/v198/qarkaxhija22a.html). The architecture is implemented in pathpyG and can be readily applied to temporal graph data. \n",
Expand Down
44 changes: 35 additions & 9 deletions docs/tutorial/netzschleuder.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@
"source": [
"# Accessing the Netzschleuder Repository\n",
"\n",
"## Prerequisites\n",
"\n",
"First, we need to set up our Python environment that has PyTorch, PyTorch Geometric and PathpyG installed. Depending on where you are executing this notebook, this might already be (partially) done. E.g. Google Colab has PyTorch installed by default so we only need to install the remaining dependencies. The DevContainer that is part of our GitHub Repository on the other hand already has all of the necessary dependencies installed. \n",
"\n",
"In the following, we install the packages for usage in Google Colab using Jupyter magic commands. For other environments comment in or out the commands as necessary. For more details on how to install `pathpyG` especially if you want to install it with GPU-support, we refer to our [documentation](https://www.pathpy.net/dev/getting_started/). Note that `%%capture` discards the full output of the cell to not clutter this tutorial with unnecessary installation details. If you want to print the output, you can comment `%%capture` out."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"# !pip install torch\n",
"!pip install torch_geometric\n",
"!pip install git+https://github.com/pathpy/pathpyG.git"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Motivation and Learning Objectives\n",
"\n",
"Access to a large number of graphs with different topological characteristics and from different domains is crucial for the development and evaluation of graph learning methods. Tousands of graph data sets are available scattered throughout the web, possibly using different data formats and with missing information on their actual origin. Addressing this issue the [Netschleuder Online Repository](https://networks.skewed.de/) by Tiago Peixoto provides a single repository of graphs in a single format, including descriptions, citations, and node-/edge- or graph-level meta-data. To facilitate the development of graph learning techniques, pathpyG provides a feature that allows to directly read networks from the netzschleuder repository via an API.\n",
Expand All @@ -17,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -52,7 +75,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -94,7 +117,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -111,6 +134,9 @@
"Graph attributes\n",
"\tnum_nodes\t\t<class 'int'>\n",
"\ttags\t\t<class 'list'>\n",
"\turl\t\t<class 'str'>\n",
"\tname\t\t<class 'str'>\n",
"\tnum_nodes\t\t<class 'int'>\n",
"\tcitation\t\t<class 'str'>\n",
"\tname\t\t<class 'str'>\n",
"\turl\t\t<class 'str'>\n",
Expand All @@ -126,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -422,7 +448,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -446,7 +472,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -734,7 +760,7 @@
"<pathpyG.visualisations.network_plots.StaticNetworkPlot at 0x7fab2bf61720>"
]
},
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -752,7 +778,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -843,7 +869,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand Down
27 changes: 25 additions & 2 deletions docs/tutorial/paths_higher_order.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@
"source": [
"# Paths and Higher-Order De Bruijn Graph Models\n",
"\n",
"## Prerequisites\n",
"\n",
"First, we need to set up our Python environment that has PyTorch, PyTorch Geometric and PathpyG installed. Depending on where you are executing this notebook, this might already be (partially) done. E.g. Google Colab has PyTorch installed by default so we only need to install the remaining dependencies. The DevContainer that is part of our GitHub Repository on the other hand already has all of the necessary dependencies installed. \n",
"\n",
"In the following, we install the packages for usage in Google Colab using Jupyter magic commands. For other environments comment in or out the commands as necessary. For more details on how to install `pathpyG` especially if you want to install it with GPU-support, we refer to our [documentation](https://www.pathpy.net/dev/getting_started/). Note that `%%capture` discards the full output of the cell to not clutter this tutorial with unnecessary installation details. If you want to print the output, you can comment `%%capture` out."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%%capture\n",
"# !pip install torch\n",
"!pip install torch_geometric\n",
"!pip install git+https://github.com/pathpy/pathpyG.git"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Motivation and Learning Objective\n",
"\n",
"While `pathpyG` is useful to handle and visualize static graphs - as the name suggests - its main advantage is that it facilitates the analysis of time series data that can be used to calculate **paths** in a graph. As we shall see in the following tutorial, there are various situations in which naturally have access to data on paths, including data on (random) walks or trajectories, traces of dynamical processes giving rise to node sequences or directed acyclic graphs, or temporal graph data with time-stamped edges. ``pathpyG` ca nbe used to model patterns in such data based on higher-order De Bruijn graph models, a modelling framework that captures patterns in time series data on graphs.\n",
Expand All @@ -17,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1446,7 +1469,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down
Loading