Skip to content

Commit

Permalink
Merge pull request #370 from datamol-io/dependency
Browse files Browse the repository at this point in the history
Tutorial update and dependency fix
  • Loading branch information
DomInvivo authored Jun 30, 2023
2 parents 2257638 + 52c89df commit 095147a
Show file tree
Hide file tree
Showing 12 changed files with 151 additions and 1,953 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ source PATH_TO_SDK/enable

# Install the IPU specific and graphium requirements
PACKAGE_NAME=pytorch pip install -r requirements_ipu.txt
pip install -r lightning.txt

# Install Graphium in dev mode
pip install --no-deps -e .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down
75 changes: 37 additions & 38 deletions docs/tutorials/feature_processing/choosing_parallelization.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "0693c5c9",
"metadata": {},
Expand Down Expand Up @@ -139,7 +138,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b2e528726a384b258d6ed3576bc0db1c",
"model_id": "3e939cd3a24742038b804bbfd961377d",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -185,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"id": "845a72d5-0b3f-4a21-8d7d-8312671e9924",
"metadata": {
"tags": []
Expand All @@ -194,7 +193,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "85e79375f3e94d9abc435bdc8d28d2df",
"model_id": "0187ede3dbd8429995511883319e246f",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -208,7 +207,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f5df65b3d2474b02aff1058e044f7dcf",
"model_id": "fdd5ac6375b444359f6e8cef7b755b9b",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -222,7 +221,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3a5170b0055e4971bd0ea5e7b6cdcbd8",
"model_id": "c11c5894843a46848725d0c03fef9e02",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -236,7 +235,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fa091db65b454db4bc824439645290ad",
"model_id": "bd34e1a806604192bbd6f95ba6435b44",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -286,7 +285,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a9de4fa3630e4c9aa4d81cac4f10b4c8",
"model_id": "928c2236948d4a109c79a6bc79bd4649",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -368,18 +367,18 @@
" <td>True</td>\n",
" <td>1000.0</td>\n",
" <td>loky_processes</td>\n",
" <td>0.014199</td>\n",
" <td>0.851930</td>\n",
" <td>0.015375</td>\n",
" <td>0.922496</td>\n",
" <td>133885</td>\n",
" <td>0.000006</td>\n",
" <td>0.000007</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>True</td>\n",
" <td>100.0</td>\n",
" <td>loky_processes</td>\n",
" <td>0.037132</td>\n",
" <td>2.227947</td>\n",
" <td>0.037034</td>\n",
" <td>2.222021</td>\n",
" <td>133885</td>\n",
" <td>0.000017</td>\n",
" </tr>\n",
Expand All @@ -388,61 +387,61 @@
" <td>True</td>\n",
" <td>10000.0</td>\n",
" <td>loky_processes</td>\n",
" <td>0.047438</td>\n",
" <td>2.846266</td>\n",
" <td>0.055083</td>\n",
" <td>3.304987</td>\n",
" <td>133885</td>\n",
" <td>0.000021</td>\n",
" <td>0.000025</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>False</td>\n",
" <td>NaN</td>\n",
" <td>pandarallel</td>\n",
" <td>0.118230</td>\n",
" <td>7.093791</td>\n",
" <td>0.121338</td>\n",
" <td>7.280271</td>\n",
" <td>133885</td>\n",
" <td>0.000053</td>\n",
" <td>0.000054</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>True</td>\n",
" <td>10.0</td>\n",
" <td>loky_processes</td>\n",
" <td>0.222177</td>\n",
" <td>13.330603</td>\n",
" <td>0.165935</td>\n",
" <td>9.956113</td>\n",
" <td>133885</td>\n",
" <td>0.000100</td>\n",
" <td>0.000074</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>False</td>\n",
" <td>NaN</td>\n",
" <td>loky_processes</td>\n",
" <td>4.002346</td>\n",
" <td>240.140754</td>\n",
" <td>3.639053</td>\n",
" <td>218.343192</td>\n",
" <td>133885</td>\n",
" <td>0.001794</td>\n",
" <td>0.001631</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" batch batch_size scheduler duration_minutes duration_seconds \n",
"3 True 1000.0 loky_processes 0.014199 0.851930 \\\n",
"2 True 100.0 loky_processes 0.037132 2.227947 \n",
"4 True 10000.0 loky_processes 0.047438 2.846266 \n",
"5 False NaN pandarallel 0.118230 7.093791 \n",
"1 True 10.0 loky_processes 0.222177 13.330603 \n",
"0 False NaN loky_processes 4.002346 240.140754 \n",
" batch batch_size scheduler duration_minutes duration_seconds \\\n",
"3 True 1000.0 loky_processes 0.015375 0.922496 \n",
"2 True 100.0 loky_processes 0.037034 2.222021 \n",
"4 True 10000.0 loky_processes 0.055083 3.304987 \n",
"5 False NaN pandarallel 0.121338 7.280271 \n",
"1 True 10.0 loky_processes 0.165935 9.956113 \n",
"0 False NaN loky_processes 3.639053 218.343192 \n",
"\n",
" n_rows duration_seconds_per_mol \n",
"3 133885 0.000006 \n",
"3 133885 0.000007 \n",
"2 133885 0.000017 \n",
"4 133885 0.000021 \n",
"5 133885 0.000053 \n",
"1 133885 0.000100 \n",
"0 133885 0.001794 "
"4 133885 0.000025 \n",
"5 133885 0.000054 \n",
"1 133885 0.000074 \n",
"0 133885 0.001631 "
]
},
"execution_count": 8,
Expand Down Expand Up @@ -476,7 +475,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "graphium_ipu",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
37 changes: 13 additions & 24 deletions docs/tutorials/feature_processing/csv_to_parquet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pyarrow as pa\n",
"import pyarrow.parquet as pq\n",
"import pandas as pd\n",
"from google.cloud import storage\n",
"from io import StringIO\n",
"import graphium\n",
"import os\n",
"from os.path import dirname, abspath\n",
"\n",
"MAIN_DIR = dirname(dirname(abspath(graphium.__file__)))\n",
Expand All @@ -28,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -39,14 +33,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/oleksandr/code/graphium/docs/tutorials/basics\n"
"/nethome/andyh/graphium/docs/tutorials/feature_processing\r\n"
]
}
],
Expand All @@ -58,30 +52,26 @@
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/oleksandr/code/graphium/graphium'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import graphium\n",
"import os\n",
"from os.path import dirname, abspath\n",
"MAIN_DIR = dirname(dirname(abspath(graphium.__file__)))\n",
"os.chdir(MAIN_DIR) # No need for this file"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.10 ('graphium_ipu')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -97,7 +87,6 @@
"pygments_lexer": "ipython3",
"version": "3.8.10"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "b813b16c721ca8d9e65e6e6945a38a6ae48015ae799c455bab639da90d3bb278"
Expand Down
14 changes: 7 additions & 7 deletions docs/tutorials/gnn/making_gnn_networks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"import dgl\n",
"from copy import deepcopy\n",
"\n",
"from graphium.nn.dgl_layers import PNAMessagePassingLayer\n",
"from graphium.nn.architectures import FullDGLNetwork\n",
"from goli.nn.dgl_layers import PNAMessagePassingLayer\n",
"from goli.nn.architectures import FullDGLNetwork\n",
"\n",
"_ = torch.manual_seed(42)"
]
Expand Down Expand Up @@ -97,7 +97,7 @@
"\n",
"- `gnn_kwargs`: The parameters used by a feed-forward **graph** neural network on the features after it has passed through the pre-processing neural network. See class `FeedForwardDGL` for details on the required parameters.\n",
"\n",
"- `graph_output_nn_kwargs`: The parameters used by a feed-forward neural network on the features after the GNN layers. See class `FeedForwardNN` for details on the required parameters. Will be ignored if set to `None`."
"- `post_nn_kwargs`: The parameters used by a feed-forward neural network on the features after the GNN layers. See class `FeedForwardNN` for details on the required parameters. Will be ignored if set to `None`."
]
},
{
Expand All @@ -118,7 +118,7 @@
" \"batch_norm\": True,\n",
" \"dropout\": 0.2, }\n",
"\n",
"graph_output_nn_kwargs = {\n",
"post_nn_kwargs = {\n",
" \"in_dim\": temp_dim_2,\n",
" \"out_dim\": out_dim,\n",
" \"hidden_dims\": [6, 6],\n",
Expand Down Expand Up @@ -150,7 +150,7 @@
"gnn_net = FullDGLNetwork(\n",
" pre_nn_kwargs=pre_nn_kwargs, \n",
" gnn_kwargs=gnn_kwargs, \n",
" graph_output_nn_kwargs=graph_output_nn_kwargs).to(float)"
" post_nn_kwargs=post_nn_kwargs).to(float)"
]
},
{
Expand Down Expand Up @@ -202,7 +202,7 @@
"metadata": {
"kernelspec": {
"name": "python3",
"display_name": "Python 3.8.8 64-bit ('graphium': conda)"
"display_name": "Python 3.8.8 64-bit ('goli': conda)"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -229,4 +229,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
6 changes: 3 additions & 3 deletions docs/tutorials/gnn/using_gnn_layers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"orig_nbformat": 2,
"kernelspec": {
"name": "python3",
"display_name": "Python 3.8.8 64-bit ('graphium': conda)"
"display_name": "Python 3.8.8 64-bit ('goli': conda)"
},
"interpreter": {
"hash": "f4a99d018a205fcbcc0480c84566beaebcb91b08d0414b39a842df533e2a1d25"
Expand Down Expand Up @@ -56,7 +56,7 @@
"import dgl\n",
"from copy import deepcopy\n",
"\n",
"from graphium.nn.dgl_layers import (\n",
"from goli.nn.dgl_layers import (\n",
" GCNLayer,\n",
" GINLayer,\n",
" GATLayer,\n",
Expand Down Expand Up @@ -376,4 +376,4 @@
"source": []
}
]
}
}
Loading

0 comments on commit 095147a

Please sign in to comment.