Unverified Commit 416e2425 authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

[Misc] Further polish gcn2conv.py (#6046)


Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
parent 87a41e50
...@@ -254,13 +254,13 @@ class GCN2Conv(nn.Module): ...@@ -254,13 +254,13 @@ class GCN2Conv(nn.Module):
# initial residual connection to the first layer # initial residual connection to the first layer
feat_0 = feat_0[: feat.size(0)] * self.alpha feat_0 = feat_0[: feat.size(0)] * self.alpha
feat_sum = feat + feat_0
if self._project_initial_features: if self._project_initial_features:
feat_sum = feat + feat_0 feat_proj_sum = feat_sum @ self.weight1
rst = (1 - self.beta) * feat_sum + self.beta * feat_sum @ self.weight1
else: else:
feat_sum = feat + feat_0
feat_proj_sum = feat @ self.weight1 + feat_0 @ self.weight2 feat_proj_sum = feat @ self.weight1 + feat_0 @ self.weight2
rst = (1 - self.beta) * feat_sum + self.beta * feat_proj_sum rst = (1 - self.beta) * feat_sum + self.beta * feat_proj_sum
if self._bias: if self._bias:
......
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