Skip to content

Add support for edge features to GraphSAGE#1581

Draft
huonw wants to merge 8 commits intodevelopfrom
feature/1328-graphsage-edge-features
Draft

Add support for edge features to GraphSAGE#1581
huonw wants to merge 8 commits intodevelopfrom
feature/1328-graphsage-edge-features

Conversation

@huonw
Copy link
Contributor

@huonw huonw commented May 20, 2020

This allows a GraphSAGE generator to optionally include the features of edges that were traversed, and thus the model to factor these features into its predictions.

See: #1328

Base automatically changed from feature/1327-edge-features to develop May 22, 2020 06:22
@huonw huonw force-pushed the feature/1328-graphsage-edge-features branch from 75261df to 3df8da4 Compare September 28, 2020 06:31
# finished i-th walk from node so add it to the list of walks as a list
walks.append(walk)
if include_edges:
assert len(walk_edges) == len(walk) - 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

if generator.use_edge_features:
edge_feature_sizes = generator.graph.edge_feature_sizes()
# the generator validates there's only one edge type
assert len(edge_feature_sizes) == 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

]
)
# there's never an edge for the head node (i.e. first element), so don't include it
assert np.size(edge_features[0]) == 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

for layer_nodes in nodes_per_hop
]
# there's never an edge for the head node (i.e. first element), so don't include it
assert np.size(edge_features[0]) == 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 3df8da4 and detected 10 issues on this pull request.

Here's the issue category breakdown:

Category Count
Security 10

View more on Code Climate.

@abhishek-vrni
Copy link

Any updates if this is going to be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants