Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
80fb4dbe
Unverified
Commit
80fb4dbe
authored
Feb 17, 2022
by
Rhett Ying
Committed by
GitHub
Feb 17, 2022
Browse files
[Doc] fix examples (#3747)
parent
9e358dfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
python/dgl/nn/pytorch/conv/appnpconv.py
python/dgl/nn/pytorch/conv/appnpconv.py
+11
-11
python/dgl/nn/pytorch/conv/sgconv.py
python/dgl/nn/pytorch/conv/sgconv.py
+1
-1
No files found.
python/dgl/nn/pytorch/conv/appnpconv.py
View file @
80fb4dbe
...
@@ -45,17 +45,17 @@ class APPNPConv(nn.Module):
...
@@ -45,17 +45,17 @@ class APPNPConv(nn.Module):
>>> feat = th.ones(6, 10)
>>> feat = th.ones(6, 10)
>>> conv = APPNPConv(k=3, alpha=0.5)
>>> conv = APPNPConv(k=3, alpha=0.5)
>>> res = conv(g, feat)
>>> res = conv(g, feat)
>>> res
>>>
print(
res
)
tensor([[
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000
,
tensor([[
0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536
,
1.0000
],
0.8536
],
[
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000
,
[
0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268
,
1.0000
],
0.9268
],
[
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000
,
[
0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634
,
1.0000
],
0.9634
],
[
1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303
,
[
0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268
,
1.0303
],
0.9268
],
[0.
8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643
,
[0.
9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634
,
0.
8643
],
0.
9634
],
[0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000,
[0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000,
0.5000]])
0.5000]])
"""
"""
...
...
python/dgl/nn/pytorch/conv/sgconv.py
View file @
80fb4dbe
...
@@ -75,7 +75,7 @@ class SGConv(nn.Module):
...
@@ -75,7 +75,7 @@ class SGConv(nn.Module):
>>> g = dgl.graph(([0,1,2,3,2,5], [1,2,3,4,0,3]))
>>> g = dgl.graph(([0,1,2,3,2,5], [1,2,3,4,0,3]))
>>> g = dgl.add_self_loop(g)
>>> g = dgl.add_self_loop(g)
>>> feat = th.ones(6, 10)
>>> feat = th.ones(6, 10)
>>> conv = SGConv(10, 2, k=2
, cached=True
)
>>> conv = SGConv(10, 2, k=2)
>>> res = conv(g, feat)
>>> res = conv(g, feat)
>>> res
>>> res
tensor([[-1.9441, -0.9343],
tensor([[-1.9441, -0.9343],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment