diff --git a/docs/tutorial/basic_concepts.ipynb b/docs/tutorial/basic_concepts.ipynb index d68c6dc8c..2afae5e70 100644 --- a/docs/tutorial/basic_concepts.ipynb +++ b/docs/tutorial/basic_concepts.ipynb @@ -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", @@ -17,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -627,7 +650,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -636,7 +659,7 @@ "Data(edge_index=[2, 3], num_nodes=3)" ] }, - "execution_count": 17, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } diff --git a/docs/tutorial/dbgnn.ipynb b/docs/tutorial/dbgnn.ipynb index 777097cc0..f712042f2 100644 --- a/docs/tutorial/dbgnn.ipynb +++ b/docs/tutorial/dbgnn.ipynb @@ -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", diff --git a/docs/tutorial/netzschleuder.ipynb b/docs/tutorial/netzschleuder.ipynb index d8ea4cb36..cb51cab6e 100644 --- a/docs/tutorial/netzschleuder.ipynb +++ b/docs/tutorial/netzschleuder.ipynb @@ -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", @@ -17,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -52,7 +75,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -94,7 +117,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -111,6 +134,9 @@ "Graph attributes\n", "\tnum_nodes\t\t\n", "\ttags\t\t\n", + "\turl\t\t\n", + "\tname\t\t\n", + "\tnum_nodes\t\t\n", "\tcitation\t\t\n", "\tname\t\t\n", "\turl\t\t\n", @@ -126,7 +152,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -422,7 +448,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -446,7 +472,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -734,7 +760,7 @@ "" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -752,7 +778,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -843,7 +869,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ diff --git a/docs/tutorial/paths_higher_order.ipynb b/docs/tutorial/paths_higher_order.ipynb index 2b77c1cc0..15d5e0e73 100644 --- a/docs/tutorial/paths_higher_order.ipynb +++ b/docs/tutorial/paths_higher_order.ipynb @@ -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", @@ -17,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -1446,7 +1469,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, "outputs": [ { diff --git a/docs/tutorial/temporal_graphs.ipynb b/docs/tutorial/temporal_graphs.ipynb index 7aa598b00..dbc24db31 100644 --- a/docs/tutorial/temporal_graphs.ipynb +++ b/docs/tutorial/temporal_graphs.ipynb @@ -6,9 +6,11 @@ "source": [ "# Temporal Graphs and Path Data\n", "\n", - "## Motivation and Learning Objectives\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 this tutorial we will introduce the representation of temporal graph data in the `Temporal Graph` class and how such data can be used to calculate time respecting paths.\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." ] }, { @@ -16,6 +18,27 @@ "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", + "In this tutorial we will introduce the representation of temporal graph data in the `Temporal Graph` class and how such data can be used to calculate time respecting paths." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], "source": [ "import torch\n", "from torch_geometric.data import TemporalData\n", @@ -28,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -53,7 +76,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -70,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -91,7 +114,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -100,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -136,7 +159,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -159,7 +182,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -184,7 +207,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -281,7 +304,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -312,7 +335,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -734,7 +757,7 @@ "" ] }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -753,7 +776,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -762,7 +785,7 @@ "TemporalData(src=[7], dst=[7], t=[7])" ] }, - "execution_count": 12, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -773,7 +796,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -797,7 +820,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -821,7 +844,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -852,7 +875,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { diff --git a/docs/tutorial/visualisation.ipynb b/docs/tutorial/visualisation.ipynb index 7b6231187..ce5992f0d 100644 --- a/docs/tutorial/visualisation.ipynb +++ b/docs/tutorial/visualisation.ipynb @@ -6,6 +6,29 @@ "source": [ "# Interactiv Graph Visualization\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\n", "\n", "This tutorial is specifically designed to guide you through the process of visualizing your data using `pathpyG`, an advanced data visualization tool. Data visualization is a crucial aspect of data analysis and interpretation, allowing for the transformation of complex datasets into visually appealing and easy-to-understand formats. pathpyG excels in this area by providing a range of functionalities that cater to both beginners and advanced users. Throughout this tutorial, you will be introduced to the basic and advanced features of pathpyG, empowering you to effectively visualize your data. This will not only enhance your understanding of your data but also enable you to communicate your findings more effectively to others.\n", @@ -31,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -57,7 +80,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 3, "metadata": { "scrolled": true }, @@ -93,7 +116,7 @@ "\n", "\n", "\n", - "
\n", + "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "