Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiya committed Oct 17, 2019
2 parents 5df6ec1 + 42b923a commit 221e7ce
Show file tree
Hide file tree
Showing 40 changed files with 11,372 additions and 10 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ Most recent releases are shown at the top. Each release shows:
- **Changed**: Additional parameters, changes to inputs or outputs, etc
- **Fixed**: Bug fixes that don't change documented behaviour

## 0.5.1 (2019-10-17)

### New:
- N/A

### Changed:
- N/A


### Fixed:
- store a local version of `stellargraph` to prevent it from installing `tensorflow-cpu`
and overriding existing `tensorflow-gpu` installation




## 0.5.0 (2019-10-16)

### New:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- better support for custom data formats and models
- support for using *ktrain* with `tf.keras`
- **2019-10-16:**
- *ktrain v0.5.0* is released and includes pre-canned support for [node classification in graphs](https://nbviewer.jupyter.org/github/amaiya/ktrain/blob/master/examples/graphs/hateful_twitter_users-GraphSAGE.ipynb).
- *ktrain* v0.5.x is released and includes pre-canned support for [node classification in graphs](https://nbviewer.jupyter.org/github/amaiya/ktrain/blob/master/examples/graphs/hateful_twitter_users-GraphSAGE.ipynb).
----


Expand Down
4 changes: 4 additions & 0 deletions ktrain/graph/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from ..imports import *
from .. import utils as U
from .node_generator import NodeSequenceWrapper
from . import stellargraph as sg
from .stellargraph.mapper import GraphSAGENodeGenerator, GraphSAGELinkGenerator
from .stellargraph.layer import GraphSAGE




Expand Down
2 changes: 1 addition & 1 deletion ktrain/graph/node_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from stellargraph.mapper import node_mappers
from .stellargraph.mapper import node_mappers

class NodeSequenceWrapper(node_mappers.NodeSequence):
def __init__(self, node_seq):
Expand Down
6 changes: 5 additions & 1 deletion ktrain/graph/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from ..preprocessor import Preprocessor
from .node_generator import NodeSequenceWrapper

from . import stellargraph as sg
from .stellargraph.mapper import GraphSAGENodeGenerator, GraphSAGELinkGenerator
from .stellargraph.layer import GraphSAGE



class NodePreprocessor(Preprocessor):
"""
Expand Down Expand Up @@ -77,7 +82,6 @@ def preprocess_train(self, node_ids):
# return generator
G_sg = sg.StellarGraph(self.G, node_features=self.df[self.feature_names])
self.G_sg = G_sg
#print(G_sg.info())
generator = GraphSAGENodeGenerator(G_sg, U.DEFAULT_BS, [self.sampsize, self.sampsize])
train_gen = generator.flow(df_tr.index, train_targets, shuffle=True)
return NodeSequenceWrapper(train_gen)
Expand Down
45 changes: 45 additions & 0 deletions ktrain/graph/stellargraph/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
Stellar Machine Learning Library
"""

__all__ = [
"data",
"layer",
"mapper",
"utils",
"StellarDiGraph",
"StellarGraph",
"__version__",
]

from ...imports import *

# Version
from .version import __version__

# Import modules
from . import mapper, layer, utils

# Top-level imports
from .core.graph import StellarGraph, StellarDiGraph
from .core.schema import GraphSchema
from .utils.calibration import TemperatureCalibration, IsotonicCalibration
from .utils.calibration import (
plot_reliability_diagram,
expected_calibration_error,
)
from .utils.ensemble import Ensemble

# Custom layers for keras deserialization:
custom_keras_layers = {
"GraphConvolution": layer.GraphConvolution,
"GraphAttention": layer.GraphAttention,
"GraphAttentionSparse": layer.GraphAttentionSparse,
"SqueezedSparseConversion": layer.SqueezedSparseConversion,
"MeanAggregator": layer.graphsage.MeanAggregator,
"MaxPoolingAggregator": layer.graphsage.MaxPoolingAggregator,
"MeanPoolingAggregator": layer.graphsage.MeanPoolingAggregator,
"AttentionalAggregator": layer.graphsage.AttentionalAggregator,
"MeanHinAggregator": layer.hinsage.MeanHinAggregator,
}
23 changes: 23 additions & 0 deletions ktrain/graph/stellargraph/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
#
# Copyright 2018 Data61, CSIRO
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
This contains the core objects used by the StellarGraph library.
"""

from .graph import *
from .schema import *

0 comments on commit 221e7ce

Please sign in to comment.