[Doc/Feature] Refactor, doc update and behavior fix for graphs (#1983)
* Update graph * Fix for dgl.graph * from_scipy * Replace canonical_etypes with relations * from_networkx * Update for hetero_from_relations * Roll back the change of canonical_etypes to relations * heterograph * bipartite * Update doc * Fix lint * Fix lint * Fix test cases * Fix * Fix * Fix * Fix * Fix * Fix * Update * Fix test * Fix * Update * Use DGLError * Update * Update * Update * Update * Fix * Fix * Fix * Fix * Fix * Fix * Fix * Fix * Update * Fix * Update * Fix * Fix * Fix * Update * Fix * Update * Fix * Update * Update * Update * Update * Update * Update * Update * Fix * Fix * Update * Update * Update * Update * Update * Update * rewrite sanity checks * delete unnecessary checks * Update * Update * Update * Update * Update * Update * Update * Update * Fix * Update * Update * Update * Fix * Fix * Fix * Update * Fix * Update * Fix * Fix * Update * Fix * Update * Fix Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com> Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com> Co-authored-by: Quan Gan <coin2028@hotmail.com>
这个提交包含在:
@@ -76,8 +76,9 @@ class GatedGraphConv(nn.Block):
|
||||
is the output feature size.
|
||||
"""
|
||||
with graph.local_scope():
|
||||
assert graph.is_homogeneous(), \
|
||||
"not a homograph; convert it with to_homo and pass in the edge type as argument"
|
||||
assert graph.is_homogeneous, \
|
||||
"not a homogeneous graph; convert it with to_homogeneous " \
|
||||
"and pass in the edge type as argument"
|
||||
zero_pad = nd.zeros((feat.shape[0], self._out_feats - feat.shape[1]),
|
||||
ctx=feat.context)
|
||||
feat = nd.concat(feat, zero_pad, dim=-1)
|
||||
|
||||
@@ -229,8 +229,9 @@ class RelGraphConv(gluon.Block):
|
||||
mx.ndarray.NDArray
|
||||
New node features.
|
||||
"""
|
||||
assert g.is_homogeneous(), \
|
||||
"not a homograph; convert it with to_homo and pass in the edge type as argument"
|
||||
assert g.is_homogeneous, \
|
||||
"not a homogeneous graph; convert it with to_homogeneous " \
|
||||
"and pass in the edge type as argument"
|
||||
with g.local_scope():
|
||||
g.ndata['h'] = x
|
||||
g.edata['type'] = etypes
|
||||
|
||||
@@ -106,7 +106,7 @@ class TAGConv(gluon.Block):
|
||||
is size of output feature.
|
||||
"""
|
||||
with graph.local_scope():
|
||||
assert graph.is_homogeneous(), 'Graph is not homogeneous'
|
||||
assert graph.is_homogeneous, 'Graph is not homogeneous'
|
||||
|
||||
degs = graph.in_degrees().astype('float32')
|
||||
norm = mx.nd.power(mx.nd.clip(degs, a_min=1, a_max=float("inf")), -0.5)
|
||||
|
||||
在新工单中引用