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
75fca8e4
Unverified
Commit
75fca8e4
authored
Aug 20, 2021
by
Chen Kai
Committed by
GitHub
Aug 20, 2021
Browse files
[bugfix] fix the bug of DotGatConv when compute the edge_softmax (#3272)
Co-authored-by:
Zihao Ye
<
expye@outlook.com
>
parent
f6349508
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
python/dgl/nn/pytorch/conv/dotgatconv.py
python/dgl/nn/pytorch/conv/dotgatconv.py
+1
-1
No files found.
python/dgl/nn/pytorch/conv/dotgatconv.py
View file @
75fca8e4
...
@@ -208,7 +208,7 @@ class DotGatConv(nn.Module):
...
@@ -208,7 +208,7 @@ class DotGatConv(nn.Module):
graph
.
apply_edges
(
fn
.
u_dot_v
(
'ft'
,
'ft'
,
'a'
))
graph
.
apply_edges
(
fn
.
u_dot_v
(
'ft'
,
'ft'
,
'a'
))
# Step 2. edge softmax to compute attention scores
# Step 2. edge softmax to compute attention scores
graph
.
edata
[
'sa'
]
=
edge_softmax
(
graph
,
graph
.
edata
[
'a'
]
)
/
(
self
.
_out_feats
**
0.5
)
graph
.
edata
[
'sa'
]
=
edge_softmax
(
graph
,
graph
.
edata
[
'a'
]
/
self
.
_out_feats
**
0.5
)
# Step 3. Broadcast softmax value to each edge, and aggregate dst node
# Step 3. Broadcast softmax value to each edge, and aggregate dst node
graph
.
update_all
(
fn
.
u_mul_e
(
'ft'
,
'sa'
,
'attn'
),
fn
.
sum
(
'attn'
,
'agg_u'
))
graph
.
update_all
(
fn
.
u_mul_e
(
'ft'
,
'sa'
,
'attn'
),
fn
.
sum
(
'attn'
,
'agg_u'
))
...
...
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