diff --git a/.gitignore b/.gitignore index 8c717cf..8e76c9f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ # tensorboard runs runs/ +.env diff --git a/.gitignore b/.gitignore index 8c717cf..8e76c9f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ # tensorboard runs runs/ +.env diff --git a/metapath2vec.ipynb b/metapath2vec.ipynb index dac373f..6218f46 100644 --- a/metapath2vec.ipynb +++ b/metapath2vec.ipynb @@ -12,14 +12,14 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "2021-11-03 03:47:25.594278: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", + "2021-11-03 10:59:43.002841: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n" ] } @@ -29,12 +29,14 @@ "%autoreload 2\n", "\n", "import stellargraph as sg\n", + "from stellargraph.data import UniformRandomMetaPathWalk\n", + "\n", "import pandas as pd" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -88,31 +90,34 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Number of random walks: {len(walks)}\n" + "Number of random walks: 12\n" ] }, { "data": { "text/plain": [ - "[['c1', 'c2', 'c1', 'c2', 'c1'],\n", - " ['c2', 'c1', 'c2', 'c1', 'c2'],\n", + "[['c1', 't1', 'c1', 't1', 'c1'],\n", + " ['c2'],\n", " ['c3'],\n", " ['t1', 'c1', 't1', 'c1', 't1'],\n", " ['t1', 'c1', 'c2'],\n", + " ['t1', 'c1', 'c2', 'c1', 't1'],\n", " ['t2'],\n", " ['t2'],\n", + " ['t2'],\n", + " ['t3'],\n", " ['t3'],\n", " ['t3']]" ] }, - "execution_count": 7, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -125,13 +130,11 @@ "# metapath schemas as a list of lists of node types.\n", "metapaths = [\n", " ['task', 'construct', 'task'],\n", - " ['construct', 'construct'],\n", + " ['construct', 'task', 'construct'],\n", " ['task', 'construct', 'construct', 'task'],\n", + " ['task', 'construct', 'construct', 'construct', 'task'],\n", "]\n", "\n", - "\n", - "from stellargraph.data import UniformRandomMetaPathWalk\n", - "\n", "rw = UniformRandomMetaPathWalk(G)\n", "\n", "walks = rw.run(\n", @@ -141,7 +144,7 @@ " metapaths=metapaths, # the metapaths\n", ")\n", "\n", - "print('Number of random walks: {len(walks)}')\n", + "print(f'Number of random walks: {len(walks)}')\n", "walks" ] },