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
87310503
Unverified
Commit
87310503
authored
Sep 03, 2019
by
VoVAllen
Committed by
GitHub
Sep 03, 2019
Browse files
[Example] Fix GIN Example (#826)
* Add serialization * fix gin * Add serialization * fix gin * fix
parent
ddeb86f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
examples/pytorch/gin/README.md
examples/pytorch/gin/README.md
+3
-3
examples/pytorch/gin/gin.py
examples/pytorch/gin/gin.py
+2
-0
examples/pytorch/gin/main.py
examples/pytorch/gin/main.py
+2
-2
No files found.
examples/pytorch/gin/README.md
View file @
87310503
...
...
@@ -20,12 +20,12 @@ How to run
An experiment on the GIN in default settings can be run with
```
bash
python
3
main.py
python main.py
```
An experiment on the GIN in customized settings can be run with
```
bash
python
3
main.py
[
--device
0 |
--disable-cuda
]
--dataset
COLLAB
\
python main.py
[
--device
0 |
--disable-cuda
]
--dataset
COLLAB
\
--graph_pooling_type
max
--neighbor_pooling_type
sum
```
...
...
@@ -35,7 +35,7 @@ Results
Run with following with the double SUM pooling way:
(tested dataset: "MUTAG"(default), "COLLAB", "IMDBBINARY", "IMDBMULTI")
```
bash
python
3 tr
ain.py
--dataset
MUTA
B
--device
0
\
python
m
ain.py
--dataset
MUTA
G
--device
0
\
--graph_pooling_type
sum
--neighbor_pooling_type
sum
```
...
...
examples/pytorch/gin/gin.py
View file @
87310503
...
...
@@ -156,6 +156,8 @@ class GIN(nn.Module):
for
layer
in
range
(
self
.
num_layers
-
1
):
h
=
self
.
ginlayers
[
layer
](
g
,
h
)
h
=
self
.
batch_norms
[
layer
](
h
)
h
=
F
.
relu
(
h
)
hidden_rep
.
append
(
h
)
score_over_layer
=
0
...
...
examples/pytorch/gin/main.py
View file @
87310503
...
...
@@ -147,8 +147,8 @@ def main(args):
f
.
write
(
"
\n
"
)
lrbar
.
set_description
(
"
the l
earning eps with learn_eps={}
is
: {}"
.
format
(
args
.
learn_eps
,
[
layer
.
eps
.
data
for
layer
in
model
.
ginlayers
]))
"
L
earning eps with learn_eps={}: {}"
.
format
(
args
.
learn_eps
,
[
layer
.
eps
.
data
.
item
()
for
layer
in
model
.
ginlayers
]))
tbar
.
close
()
vbar
.
close
()
...
...
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