Skip to content

Commit

Permalink
Feature/fullbatch linkgenerator (stellargraph#543)
Browse files Browse the repository at this point in the history
*  Added GCN link model and added new full-batch link generator

* Fixed bug in full-batch generators. Updated unit tests.

Updated full-batch generators to return adjacency matrix in same node order as the features in the StellarGraph object. This fixes a bug that was introduced by using the 'get_index_for_node` method.

* Added LinkEmbedding layer.

* Updated all full-batch classes to use `build`

All full-batch classes (GCN, GAT, APPNP, PPNP) now support creating a link model

* Updated demos to use `build` rather than `node_model` or `link_model`

* Formatted GCN link prediction notebook.

* Removed erroneous format_notebook script

* Fixed bug in stellargraph using deprecated `.node` method

* Updated docstrings and CHANGELOG.md

* Bugfix for issue introduced in previous commit

* Removed Dense layer from LinkEmbedding layer and moved to associated function. Cleaned up link tests. Misc spelling errors.

* Addressed review comments: updated notebooks to match new full-batch node order, raise error if FullBatchGenerator is instanciated.

* Added docstring describing axis to LinkEmbedding and removed argument from link_inference.

* Spelling errors fixed.

* Fixed bug in stellargraph to_adjacency_matrix when nodes are specified

* Fixed bug in unit test. Removed erroneous spaces. Updated copyright header.

* More spaces removed

* Updated documentation

Co-authored-by: Yuriy Tyshetskiy <youph@users.noreply.github.com>
  • Loading branch information
Andrew Docherty and youph authored Jan 23, 2020
1 parent 10e6200 commit bcf6d0a
Show file tree
Hide file tree
Showing 41 changed files with 7,113 additions and 1,714 deletions.
379 changes: 218 additions & 161 deletions demos/ensembles/ensemble-node-classification-example.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Expose the input and output tensors of the GAT model for node prediction, via GAT.node_model() method:\n",
"x_inp, predictions = gat.node_model()"
"# Expose the input and output tensors of the GAT model for node prediction, via GAT.build() method:\n",
"x_inp, predictions = gat.build()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@
" dropout=0.5,\n",
" activations=[\"elu\", \"elu\"]\n",
")\n",
"x_inp, x_out = base_model.node_model()\n",
"x_inp, x_out = base_model.build()\n",
"prediction = layers.Dense(units=1, activation=\"sigmoid\")(x_out)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Expose the input and output tensors of the GCN model for node prediction, via GCN.node_model() method:\n",
"x_inp, x_out = gcn.node_model()\n",
"# Expose the input and output tensors of the GCN model for node prediction, via GCN.build() method:\n",
"x_inp, x_out = gcn.build()\n",
"# Snap the final estimator layer to x_out\n",
"x_out = layers.Dense(units=train_targets.shape[1], activation=\"softmax\")(x_out)"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Expose the input and output tensors of the GCN model for node prediction, via GCN.node_model() method:\n",
"x_inp, x_out = gcn.node_model()\n",
"# Expose the input and output tensors of the GCN model for node prediction, via GCN.build() method:\n",
"x_inp, x_out = gcn.build()\n",
"# Snap the final estimator layer to x_out\n",
"x_out = layers.Dense(units=train_targets.shape[1], activation=\"softmax\")(x_out)"
]
Expand Down
Loading

0 comments on commit bcf6d0a

Please sign in to comment.