Skip to content

Commit

Permalink
Hotfix 0.8.3
Browse files Browse the repository at this point in the history
Merge branch 'hotfix-appnp'
  • Loading branch information
Yuriy Tyshetskiy committed Dec 12, 2019
2 parents f60d227 + 27cb31e commit 67d34a9
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 199 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [0.8.3](https://github.com/stellargraph/stellargraph/tree/v0.8.3)

**Fixed bugs:**
- Fixed the issue in the APPNP class that causes appnp to propagate excessive dropout layers. [\#525](https://github.com/stellargraph/stellargraph/pull/525)
- Added a fix into the PPNP node classification demo so that the softmax layer is no longer propagated.

## [0.8.2](https://github.com/stellargraph/stellargraph/tree/v0.8.2)

**Fixed bugs:**
Expand Down

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions stellargraph/layer/appnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class APPNP:
bias (bool): toggles an optional bias in fully connected layers
dropout (float): dropout rate applied to input features of each layer
kernel_regularizer (str): normalization applied to the kernels of fully connetcted layers
teleport_probability: "probability" of returning to the starting node in the propogation step as desribed in
teleport_probability: "probability" of returning to the starting node in the propagation step as desribed in
the paper (alpha in the paper)
approx_iter: number of iterations to approximate PPNP as described in the paper (K in the paper)
"""
Expand Down Expand Up @@ -305,12 +305,15 @@ def __call__(self, x):
)

h_layer = x_in
for layer in self._layers:

for layer in self._layers[: (2 * len(self.layer_sizes))]:
h_layer = layer(h_layer)

feature_layer = h_layer

for layer in self._layers[(2 * len(self.layer_sizes)):]:
if isinstance(layer, APPNPPropagationLayer):
h_layer = layer([h_layer, feature_layer, out_indices] + Ainput)
elif isinstance(layer, Dense):
h_layer = layer(h_layer)
feature_layer = h_layer
else:
# For other (non-graph) layers only supply the input tensor
h_layer = layer(h_layer)
Expand Down Expand Up @@ -359,7 +362,7 @@ def node_model(self):

def propagate_model(self, base_model):
"""
Propagates a trained kera model to create a node model.
Propagates a trained model using personalised PageRank.
Args:
base_model (keras Model): trained model with node features as input, predicted classes as output
Expand Down Expand Up @@ -403,15 +406,15 @@ def propagate_model(self, base_model):

# pass the node features through the base model
feature_layer = x_t
for layer in base_model.layers:
for layer in base_model.layers[1:]:
feature_layer = layer(feature_layer)

h_layer = feature_layer
# iterate through APPNPPropagation layers
for layer in self._layers:
for layer in self._layers[(2 * len(self.layer_sizes)) :]:
if isinstance(layer, APPNPPropagationLayer):
h_layer = layer([h_layer, feature_layer, out_indices_t] + Ainput)
elif isinstance(layer, Dropout):
else:
h_layer = layer(h_layer)

x_out = h_layer
Expand Down
2 changes: 1 addition & 1 deletion stellargraph/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Global version information
__version__ = "0.8.2"
__version__ = "0.8.3"

0 comments on commit 67d34a9

Please sign in to comment.