Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/stellargraph/stellargraph
Browse files Browse the repository at this point in the history
…into feature/gat
  • Loading branch information
Yuriy Tyshetskiy committed Feb 15, 2019
2 parents 7bd4cdf + c54fa23 commit 722dbc8
Show file tree
Hide file tree
Showing 47 changed files with 9,189 additions and 772 deletions.
21 changes: 9 additions & 12 deletions .buildkite/pipeline.yml
@@ -1,25 +1,22 @@
steps:
- label: ":python:"
command:
- pip install -q --no-cache-dir -r requirements.txt -e .
&& py.test -ra --cov=stellargraph tests/ --doctest-modules --doctest-modules --cov-report=term-missing -p no:cacheprovider
&& coveralls
command: ".buildkite/script.sh"
plugins:
docker#v1.3.0:
docker#v3.0.1:
image: "python:3.6"
workdir: /app
environment:
- PYTHONDONTWRITEBYTECODE=1
- COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN
- GIT_BRANCH=$BUILDKITE_BRANCH
- COVERALLS_REPO_TOKEN
- BUILDKITE_BUILD_NUMBER
- BUILDKITE_BRANCH
- AWS_LOGS_BUCKET

- label: "style"
command:
- --check stellargraph tests
plugins:
docker#v1.3.0:
docker#v3.0.1:
image: "stellargraph/black"
workdir: /app
entrypoint: /usr/bin/black
command: ["--check", "stellargraph", "tests"]
environment:
- PYTHONDONTWRITEBYTECODE=1

Expand Down
15 changes: 15 additions & 0 deletions .buildkite/script.sh
@@ -0,0 +1,15 @@
#!/bin/bash

set -xeo pipefail

upload_tests() {
buildkite-agent artifact upload "${BUILDKITE_BUILD_NUMBER}.xml" s3://${AWS_LOGS_BUCKET}/pytest/${BUILDKITE_BRANCH}/${BUILDKITE_BUILD_NUMBER}
}

pip install -q --no-cache-dir -r requirements.txt -e .
py.test -ra --cov=stellargraph tests/ --doctest-modules --doctest-modules --cov-report=term-missing -p no:cacheprovider --junitxml=./${BUILDKITE_BUILD_NUMBER}.xml
coveralls

if [ "${BUILDKITE_BRANCH}" = "develop" ] || [ "${BUILDKITE_BRANCH}" = "master" ] ; then
upload_tests
fi
5 changes: 4 additions & 1 deletion .github/issue_template.md
Expand Up @@ -16,6 +16,7 @@ so that:
- [ ] Code well commented
- [ ] Documentation on Google Docs
- [ ] Documentation in repo
- [ ] CHANGELOG.md updated
- [ ] Team demo
- [ ] Mini-meetup talk
- [ ] Stakeholder sign-off
Expand All @@ -34,4 +35,6 @@ so that:
- [ ] Branch and Pull Request pass integration tests on CI
- [ ] Version number reflects new status
- [ ] Peer Code Review Performed
- [ ] Code well commented
- [ ] Code well commented
- [ ] CHANGELOG.md updated

10 changes: 10 additions & 0 deletions .readthedocs.yaml
@@ -0,0 +1,10 @@
# .readthedocs.yml

version: 2

python:
version: 3.6
install:
- requirements: requirements.txt
- method: pip
path: .
3 changes: 3 additions & 0 deletions AUTHORS
Expand Up @@ -14,6 +14,9 @@ GraphSAGE algorithm:
Copyright (c) 2017 William L. Hamilton, Rex Ying | MIT License
Copyright (c) 2016 Thomas Kipf | MIT License

Graph Convolutional Networks (GCN) algorithm:
Copyright (c) 2016 Thomas Kipf | MIT License

GAT algorithm:
Copyright (c) 2018 Daniele Grattarola | MIT License
Copyright (c) 2018 Petar Veličković | MIT License
31 changes: 31 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,31 @@
# Change Log

## [0.5.0](https://github.com/stellargraph/stellargraph/tree/v0.5.0) (11 Feb 2019)

**Implemented new features and enhancements:**

- Added model calibration [\#326](https://github.com/stellargraph/stellargraph/pull/326)
- Added `GraphConvolution` layer, `GCN` class for a stack of `GraphConvolution` layers,
and `FullBatchNodeGenerator` class for feeding data into `GCN` models [\#318](https://github.com/stellargraph/stellargraph/pull/318)
- Added GraphSAGE attention aggregator [\#317](https://github.com/stellargraph/stellargraph/pull/317)
- Added GraphSAGE MaxPoolAggregator and MeanPoolAggregator [\#278](https://github.com/stellargraph/stellargraph/pull/278)
- Added shuffle option to all `flow` methods for GraphSAGE and HinSAGE generators [\#328](https://github.com/stellargraph/stellargraph/pull/328)
- GraphSAGE and HinSAGE: ensure that a MLP can be created by using zero samples [\#301](https://github.com/stellargraph/stellargraph/issues/301)
- Handle isolated nodes in GraphSAGE [\#294](https://github.com/stellargraph/stellargraph/issues/294)
- Ensure isolated nodes are handled correctly by GraphSAGENodeMapper and GraphSAGELinkMapper [\#182](https://github.com/stellargraph/stellargraph/issues/182)
- EdgeSplitter: introduce a switch for keeping the reduced graph connected [\#285](https://github.com/stellargraph/stellargraph/issues/285)
- Node2vec for weighted graphs [\#241](https://github.com/stellargraph/stellargraph/issues/241)
- Fix edge types in demos [\#237](https://github.com/stellargraph/stellargraph/issues/237)
- Add docstrings to StellarGraphBase class [\#175](https://github.com/stellargraph/stellargraph/issues/175)
- Make L2-normalisation of the final embeddings in GraphSAGE and HinSAGE optional [\#115](https://github.com/stellargraph/stellargraph/issues/115)
- Check/change the GraphSAGE mapper's behaviour for isolated nodes [\#100](https://github.com/stellargraph/stellargraph/issues/100)
- Added GraphSAGE node embedding extraction and visualisation [\#290](https://github.com/stellargraph/stellargraph/pull/290)

**Fixed bugs:**

- Fixed the bug in running demos when no options given [\#271](https://github.com/stellargraph/stellargraph/issues/271)
- Fixed the bug in LinkSequence that threw an error when no link targets were given [\#273](https://github.com/stellargraph/stellargraph/pull/273)

**Refactoring:**
- Refactored link inference classes to use `edge_embedding_method` instead of `edge_feature_method` [\#327](https://github.com/stellargraph/stellargraph/pull/327)

2 changes: 1 addition & 1 deletion CONTRIBUTORS
@@ -1,5 +1,5 @@
# The AUTHORS file lists the copyright holders; this file
# lists people who contributed to StellarGraph codebase.
# lists people who contributed to StellarGraph codebase.
# For example, CSIRO employees are listed here
# but not in AUTHORS, because CSIRO holds the copyright.

Expand Down
16 changes: 13 additions & 3 deletions README.md
Expand Up @@ -136,7 +136,8 @@ The StellarGraph library currently includes the following algorithms for graph m

* GraphSAGE [1]
- Supports representation learning, node classification/regression, and link prediction for homogeneous networks.
The current implementation supports mean aggregation of neighbour nodes only.
The current implementation supports multiple aggregation methods, including mean, maxpool, meanpool, and
attentional aggregators.

* HinSAGE
- Extension of GraphSAGE algorithm to heterogeneous networks.
Expand All @@ -145,7 +146,12 @@ The StellarGraph library currently includes the following algorithms for graph m
taking into account their types and the types of links between them.

* GAT
- Graph ATtention Network algorithm [4] for homogeneous networks.
- Graph ATtention Network algorithm [4] for homogeneous graphs.

* GCN
- Graph Convolutional Network algorithm [5] for homogeneous graphs.
The implementation supports representation learning and node classification for homogeneous graphs.


* Node2Vec [2]
- Unsupervised representation learning for homogeneous networks, taking into account network structure while ignoring
Expand Down Expand Up @@ -191,4 +197,8 @@ Knowledge Discovery and Data Mining (KDD), 2016. ([link](https://snap.stanford.e
Ananthram Swami. ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 135–144, 2017
([link](https://ericdongyx.github.io/metapath2vec/m2v.html))

4. Graph Attention Networks. P. Velickovic et al. ICLR 2018 ([link](https://arxiv.org/abs/1710.10903))
4. Graph Attention Networks. P. Velickovic et al. ICLR 2018 ([link](https://arxiv.org/abs/1710.10903))

5. Graph Convolutional Networks (GCN): Semi-Supervised Classification with Graph Convolutional Networks. Thomas N. Kipf, Max Welling.
International Conference on Learning Representations (ICLR), 2017
([link](https://github.com/tkipf/gcn))
40 changes: 26 additions & 14 deletions demos/README.md
@@ -1,57 +1,66 @@
## Table of Contents

This folder contains several examples of applying graph machine learning (ML) algorithms on network-structured
data to solve several common problems including node attribute inference (inferring
data to solve several common problems including node attribute inference (inferring
entity properties) and link prediction (predicting relations and/or their properties). The
examples demonstrate using the `StellarGraph` library to build machine learning
examples demonstrate using the `StellarGraph` library to build machine learning
workflows on both homogeneous and heterogeneous networks.

Each folder contains one or more examples of using the StellarGraph implementations of the
state-of-the-art algorithms, GraphSAGE [3], HinSAGE, Node2Vec [1], and Metapath2Vec [2].
GraphSAGE and HinSAGE are variants of Graph Convolutional Neural networks [5]. Node2Vec and
state-of-the-art algorithms, GraphSAGE [3], HinSAGE, GCN [5], GAT [6], Node2Vec [1], and Metapath2Vec [2].
GraphSAGE, HinSAGE, and GAT are variants of Graph Convolutional Neural networks [5]. Node2Vec and
Metapath2Vec are methods based on graph random walks and representation learning using the
Word2Vec [4] algorithm.

The examples folder structure is shown below.
The examples folder structure is shown below.

* [`/embeddings`](https://github.com/stellargraph/stellargraph/tree/master/demos/embeddings)

Examples of unsupervised node representation learning for homogeneous and heterogeneous networks,
Examples of unsupervised node representation learning for homogeneous and heterogeneous networks,
using the Node2Vec and Metapath2Vec algorithms.

* [`/link-prediction-random-walks`](https://github.com/stellargraph/stellargraph/tree/master/demos/link-prediction-random-walks)

Examples of semi-supervised link prediction for homogeneous and heterogeneous networks,
Examples of semi-supervised link prediction for homogeneous and heterogeneous networks,
using the Node2Vec and Metapath2vec algorithms.

* [`/link-prediction-graphsage`](https://github.com/stellargraph/stellargraph/tree/master/demos/link-prediction-graphsage)

Example of semi-supervised link prediction for a homogeneous network with attributed nodes,
Example of semi-supervised link prediction for a homogeneous network with attributed nodes,
using the GraphSAGE algorithm.

* [`/link-prediction-hinsage`](https://github.com/stellargraph/stellargraph/tree/master/demos/link-prediction-hinsage)

Example of supervised link attribute prediction for a heterogeneous network with attributed nodes of different types,
Example of supervised link attribute prediction for a heterogeneous network with attributed nodes of different types,
using the HinSAGE algorithm.

* [`/node-classification-graphsage`](https://github.com/stellargraph/stellargraph/tree/master/demos/node-classification-graphsage)

Example of supervised node classification for a homogeneous network with attributed nodes, using the GraphSAGE algorithm.

* [`/node-classification-gcn`](https://github.com/stellargraph/stellargraph/tree/master/demos/node-classification-gcn)

Example of semi-supervised node classification for a homogeneous network, using the GCN algorithm.

* [`/node-classification-gat`](https://github.com/stellargraph/stellargraph/tree/master/demos/node-classification-gat)

Example of supervised node classification for a homogeneous network with attributed nodes, using the GAT algorithm [6].

* [`/node-classification-node2vec`](https://github.com/stellargraph/stellargraph/tree/master/demos/node-classification-node2vec)

Example of unsupervised node representation learning using Node2Vec and supervised classification using
Example of unsupervised node representation learning using Node2Vec and supervised classification using
the Scikit-learn library.

* [`/node-classification-hinsage`](https://github.com/stellargraph/stellargraph/tree/master/demos/node-classification-hinsage)

Example of semi-supervised node classification for a heterogeneous network with multiple node and link types,
Example of semi-supervised node classification for a heterogeneous network with multiple node and link types,
using the HinSAGE algorithm.

* [`/calibration`](https://github.com/stellargraph/stellargraph/tree/master/demos/calibration)

Examples of calibrating graph convolutional neural networks, e.g., GraphSAGE, for binary and
multi-class classification problems.


## References

Expand All @@ -73,3 +82,6 @@ I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. In Advances in Neural Informa
ICLR 2017. arXiv:1609.02907 ([link](https://arxiv.org/abs/1609.02907))

6. Graph Attention Networks. P. Velickovic et al. ICLR 2018 ([link](https://arxiv.org/abs/1710.10903))

7. On Calibration of Modern Neural Networks. C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger.
ICML 2017. ([link](https://geoffpleiss.com/nn_calibration))

0 comments on commit 722dbc8

Please sign in to comment.