Skip to content

Commit

Permalink
add thumbnails for tutorials (dmlc#2695)
Browse files Browse the repository at this point in the history
Co-authored-by: Jinjing Zhou <[email protected]>
Co-authored-by: Minjie Wang <[email protected]>
  • Loading branch information
3 people authored Feb 23, 2021
1 parent da2f690 commit 71d53d9
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 3 deletions.
Binary file added docs/source/_static/blitz_1_introduction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/blitz_2_dglgraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/blitz_3_message_passing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/blitz_4_link_predict.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/blitz_6_load_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions python/dgl/nn/pytorch/conv/cfconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ def forward(self, g, node_feats, edge_feats):
Updated node representations.
"""
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.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'])
3 changes: 3 additions & 0 deletions tutorials/blitz/1_introduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,6 @@ def train(g, model):
# - :ref:`The list of datasets provided by DGL <apidata>`.
#


# Thumbnail Courtesy: Stanford CS224W Notes
# sphinx_gallery_thumbnail_path = '_static/blitz_1_introduction.png'
3 changes: 3 additions & 0 deletions tutorials/blitz/2_dglgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,6 @@
# :func:`dgl.load_graphs`
#


# Thumbnail Courtesy: Wikipedia
# sphinx_gallery_thumbnail_path = '_static/blitz_2_dglgraph.png'
3 changes: 3 additions & 0 deletions tutorials/blitz/3_message_passing.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,6 @@ def sum_udf(nodes):
# 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'
3 changes: 3 additions & 0 deletions tutorials/blitz/4_link_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,6 @@ def compute_auc(pos_score, neg_score):
neg_score = pred(test_neg_g, h)
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'
3 changes: 3 additions & 0 deletions tutorials/blitz/5_graph_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,6 @@ def forward(self, g, in_feat):
# for an end-to-end graph classification model.
#


# Thumbnail Courtesy: DGL
# sphinx_gallery_thumbnail_path = '_static/blitz_5_graph_classification.png'
3 changes: 3 additions & 0 deletions tutorials/blitz/6_load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,6 @@ def __len__(self):
graph, label = dataset[0]
print(graph, label)


# Thumbnail Courtesy: (Un)common Use Cases for Graph Databases, Michal Bachman
# sphinx_gallery_thumbnail_path = '_static/blitz_6_load_data.png'
3 changes: 3 additions & 0 deletions tutorials/large/L0_neighbor_sampling_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@
# 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'
3 changes: 2 additions & 1 deletion tutorials/large/L1_large_node_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,5 @@ def forward(self, bipartites, x):
#



# Thumbnail Courtesy: Stanford CS224W Notes
# sphinx_gallery_thumbnail_path = '_static/blitz_1_introduction.png'
3 changes: 3 additions & 0 deletions tutorials/large/L2_large_link_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,6 @@ def closure():
# for link prediction with neighbor sampling.
#


# Thumbnail Courtesy: Link Prediction with Neo4j, Mark Needham
# sphinx_gallery_thumbnail_path = '_static/blitz_4_link_predict.png'
3 changes: 3 additions & 0 deletions tutorials/large/L4_message_passing.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,6 @@ def forward(self, g, h):
h_total = torch.cat([h_dst, h_N], dim=1)
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'

0 comments on commit 71d53d9

Please sign in to comment.