Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for edge features to GraphSAGE #1581

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

huonw
Copy link
Member

@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
Copy link

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
Copy link

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
Copy link

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
Copy link

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.

@codeclimate
Copy link

codeclimate bot commented Sep 28, 2020

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.

None yet

2 participants