Unverified Commit 71d53d9e authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

add thumbnails for tutorials (#2695)


Co-authored-by: default avatarJinjing Zhou <VoVAllen@users.noreply.github.com>
Co-authored-by: default avatarMinjie Wang <wmjlyjemaine@gmail.com>
parent da2f690a
...@@ -134,7 +134,11 @@ class CFConv(nn.Module): ...@@ -134,7 +134,11 @@ class CFConv(nn.Module):
Updated node representations. Updated node representations.
""" """
with g.local_scope(): with g.local_scope():
g.ndata['hv'] = self.project_node(node_feats) if isinstance(node_feats, tuple):
node_feats_src, _ = node_feats
else:
node_feats_src = node_feats
g.srcdata['hv'] = self.project_node(node_feats_src)
g.edata['he'] = self.project_edge(edge_feats) g.edata['he'] = self.project_edge(edge_feats)
g.update_all(fn.u_mul_e('hv', 'he', 'm'), fn.sum('m', 'h')) g.update_all(fn.u_mul_e('hv', 'he', 'm'), fn.sum('m', 'h'))
return self.project_out(g.ndata['h']) return self.project_out(g.dstdata['h'])
...@@ -215,3 +215,6 @@ train(g, model) ...@@ -215,3 +215,6 @@ train(g, model)
# - :ref:`The list of datasets provided by DGL <apidata>`. # - :ref:`The list of datasets provided by DGL <apidata>`.
# #
# Thumbnail Courtesy: Stanford CS224W Notes
# sphinx_gallery_thumbnail_path = '_static/blitz_1_introduction.png'
...@@ -225,3 +225,6 @@ print(sg2) ...@@ -225,3 +225,6 @@ print(sg2)
# :func:`dgl.load_graphs` # :func:`dgl.load_graphs`
# #
# Thumbnail Courtesy: Wikipedia
# sphinx_gallery_thumbnail_path = '_static/blitz_2_dglgraph.png'
...@@ -353,3 +353,6 @@ def sum_udf(nodes): ...@@ -353,3 +353,6 @@ def sum_udf(nodes):
# Code <guide-message-passing-efficient>`. # Code <guide-message-passing-efficient>`.
# #
# Thumbnail Courtesy: Representation Learning on Networks, Jure Leskovec, WWW 2018
# sphinx_gallery_thumbnail_path = '_static/blitz_3_message_passing.png'
...@@ -339,3 +339,6 @@ with torch.no_grad(): ...@@ -339,3 +339,6 @@ with torch.no_grad():
neg_score = pred(test_neg_g, h) neg_score = pred(test_neg_g, h)
print('AUC', compute_auc(pos_score, neg_score)) print('AUC', compute_auc(pos_score, neg_score))
# Thumbnail Courtesy: Link Prediction with Neo4j, Mark Needham
# sphinx_gallery_thumbnail_path = '_static/blitz_4_link_predict.png'
...@@ -207,3 +207,6 @@ print('Test accuracy:', num_correct / num_tests) ...@@ -207,3 +207,6 @@ print('Test accuracy:', num_correct / num_tests)
# for an end-to-end graph classification model. # for an end-to-end graph classification model.
# #
# Thumbnail Courtesy: DGL
# sphinx_gallery_thumbnail_path = '_static/blitz_5_graph_classification.png'
...@@ -222,3 +222,6 @@ dataset = SyntheticDataset() ...@@ -222,3 +222,6 @@ dataset = SyntheticDataset()
graph, label = dataset[0] graph, label = dataset[0]
print(graph, label) print(graph, label)
# Thumbnail Courtesy: (Un)common Use Cases for Graph Databases, Michal Bachman
# sphinx_gallery_thumbnail_path = '_static/blitz_6_load_data.png'
...@@ -113,3 +113,6 @@ By the end of this tutorial, you will be able to ...@@ -113,3 +113,6 @@ By the end of this tutorial, you will be able to
# DGL <L1_large_node_classification>` # DGL <L1_large_node_classification>`
# #
# Thumbnail Courtesy: Understanding graph embedding methods and their applications, Mengjia Xu
# sphinx_gallery_thumbnail_path = '_static/large_L0_neighbor_sampling_overview.png'
...@@ -334,4 +334,5 @@ for epoch in range(10): ...@@ -334,4 +334,5 @@ for epoch in range(10):
# #
# Thumbnail Courtesy: Stanford CS224W Notes
# sphinx_gallery_thumbnail_path = '_static/blitz_1_introduction.png'
...@@ -364,3 +364,6 @@ for epoch in range(1): ...@@ -364,3 +364,6 @@ for epoch in range(1):
# for link prediction with neighbor sampling. # for link prediction with neighbor sampling.
# #
# Thumbnail Courtesy: Link Prediction with Neo4j, Mark Needham
# sphinx_gallery_thumbnail_path = '_static/blitz_4_link_predict.png'
...@@ -387,3 +387,6 @@ class SAGEConvForBoth(nn.Module): ...@@ -387,3 +387,6 @@ class SAGEConvForBoth(nn.Module):
h_total = torch.cat([h_dst, h_N], dim=1) h_total = torch.cat([h_dst, h_N], dim=1)
return self.linear(h_total) return self.linear(h_total)
# Thumbnail Courtesy: Representation Learning on Networks, Jure Leskovec, WWW 2018
# sphinx_gallery_thumbnail_path = '_static/blitz_3_message_passing.png'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment