"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "53bc30dd45cf2e4f85bd42c9b69c50347d6bde6d"
Unverified Commit f5b410b7 authored by Peiqi Yin's avatar Peiqi Yin Committed by GitHub
Browse files

GeniePath model add a Tanh. (#3269)



* Update model.py

* Update README.md
Co-authored-by: default avatarZihao Ye <expye@outlook.com>
parent 7f927939
...@@ -41,7 +41,14 @@ python ppi.py ...@@ -41,7 +41,14 @@ python ppi.py
Performance Performance
------------------------- -------------------------
|Dataset | Pubmed (ACC)| PPI (micro-F1)| Dataset: Pubmed (ACC)
| ------ | ----------- | ------------- | |Method | GeniePath|
| Paper | 78.5% | 0.952 | | ------ | ----------- |
| DGL | 73.0% | 0.959 | | Paper | 78.5% |
\ No newline at end of file | DGL | 73.0% |
Dataset: PPI (micro-F1)
|Method | GeniePath| GeniePath-lazy| GeniePath-lazy-residual|
| ------ | ----------- | ------------- | ------------------ |
| Paper | 0.9520 | 0.9790 | 0.9850 |
| DGL | 0.9729 | 0.9802 | 0.9798 |
...@@ -12,6 +12,7 @@ class GeniePathConv(nn.Module): ...@@ -12,6 +12,7 @@ class GeniePathConv(nn.Module):
def forward(self, graph, x, h, c): def forward(self, graph, x, h, c):
x = self.breadth_func(graph, x) x = self.breadth_func(graph, x)
x = th.tanh(x)
x = th.mean(x, dim=1) x = th.mean(x, dim=1)
x, (h, c) = self.depth_func(x.unsqueeze(0), (h, c)) x, (h, c) = self.depth_func(x.unsqueeze(0), (h, c))
x = x[0] x = x[0]
...@@ -59,7 +60,7 @@ class GeniePathLazy(nn.Module): ...@@ -59,7 +60,7 @@ class GeniePathLazy(nn.Module):
x = self.linear1(x) x = self.linear1(x)
h_tmps = [] h_tmps = []
for layer in self.breaths: for layer in self.breaths:
h_tmps.append(th.mean(layer(graph, x), dim=1)) h_tmps.append(th.mean(th.tanh(layer(graph, x)), dim=1))
x = x.unsqueeze(0) x = x.unsqueeze(0)
for h_tmp, layer in zip(h_tmps, self.depths): for h_tmp, layer in zip(h_tmps, self.depths):
in_cat = th.cat((h_tmp.unsqueeze(0), x), -1) in_cat = th.cat((h_tmp.unsqueeze(0), x), -1)
......
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