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
fdd0fe65
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "0be52c07d6b9b49245b616f9738e52bcf58cd9fe"
Unverified
Commit
fdd0fe65
authored
Nov 04, 2019
by
Zihao Ye
Committed by
GitHub
Nov 04, 2019
Browse files
hotfix (#971)
parent
9a0511c8
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
64 additions
and
46 deletions
+64
-46
examples/mxnet/monet/README.md
examples/mxnet/monet/README.md
+6
-1
examples/mxnet/monet/citation.py
examples/mxnet/monet/citation.py
+7
-1
examples/pytorch/appnp/train.py
examples/pytorch/appnp/train.py
+3
-3
examples/pytorch/cluster_gcn/cluster_gcn.py
examples/pytorch/cluster_gcn/cluster_gcn.py
+3
-3
examples/pytorch/gat/train.py
examples/pytorch/gat/train.py
+3
-3
examples/pytorch/gcn/gcn_mp.py
examples/pytorch/gcn/gcn_mp.py
+3
-3
examples/pytorch/gcn/train.py
examples/pytorch/gcn/train.py
+3
-3
examples/pytorch/graphsage/graphsage.py
examples/pytorch/graphsage/graphsage.py
+3
-3
examples/pytorch/model_zoo/citation_network/run.py
examples/pytorch/model_zoo/citation_network/run.py
+3
-3
examples/pytorch/monet/README.md
examples/pytorch/monet/README.md
+7
-2
examples/pytorch/sampling/dis_sampling/gcn_cv_sc_train.py
examples/pytorch/sampling/dis_sampling/gcn_cv_sc_train.py
+3
-3
examples/pytorch/sampling/dis_sampling/gcn_ns_sc_train.py
examples/pytorch/sampling/dis_sampling/gcn_ns_sc_train.py
+3
-3
examples/pytorch/sampling/gcn_cv_sc.py
examples/pytorch/sampling/gcn_cv_sc.py
+3
-3
examples/pytorch/sampling/gcn_ns_sc.py
examples/pytorch/sampling/gcn_ns_sc.py
+3
-3
examples/pytorch/sgc/sgc.py
examples/pytorch/sgc/sgc.py
+3
-3
examples/pytorch/sgc/sgc_reddit.py
examples/pytorch/sgc/sgc_reddit.py
+3
-3
examples/pytorch/tagcn/train.py
examples/pytorch/tagcn/train.py
+3
-3
python/dgl/nn/mxnet/softmax.py
python/dgl/nn/mxnet/softmax.py
+1
-0
python/dgl/nn/pytorch/softmax.py
python/dgl/nn/pytorch/softmax.py
+1
-0
No files found.
examples/mxnet/monet/README.md
View file @
fdd0fe65
...
@@ -11,6 +11,11 @@ Dependencies
...
@@ -11,6 +11,11 @@ Dependencies
Results
Results
=======
=======
Node classification on citation networks:
## Citation networks
Run with following (available dataset: "cora", "citeseer", "pubmed")
```
bash
python3 citation.py
--dataset
cora
--gpu
0
```
-
Cora: ~0.814
-
Cora: ~0.814
-
Pubmed: ~0.748
-
Pubmed: ~0.748
examples/mxnet/monet/citation.py
View file @
fdd0fe65
...
@@ -18,7 +18,8 @@ class MoNet(nn.Block):
...
@@ -18,7 +18,8 @@ class MoNet(nn.Block):
out_feats
,
out_feats
,
n_layers
,
n_layers
,
dim
,
dim
,
n_kernels
):
n_kernels
,
dropout
):
super
(
MoNet
,
self
).
__init__
()
super
(
MoNet
,
self
).
__init__
()
self
.
g
=
g
self
.
g
=
g
with
self
.
name_scope
():
with
self
.
name_scope
():
...
@@ -39,9 +40,13 @@ class MoNet(nn.Block):
...
@@ -39,9 +40,13 @@ class MoNet(nn.Block):
self
.
layers
.
add
(
GMMConv
(
n_hidden
,
out_feats
,
dim
,
n_kernels
))
self
.
layers
.
add
(
GMMConv
(
n_hidden
,
out_feats
,
dim
,
n_kernels
))
self
.
pseudo_proj
.
add
(
nn
.
Dense
(
dim
,
in_units
=
2
,
activation
=
'tanh'
))
self
.
pseudo_proj
.
add
(
nn
.
Dense
(
dim
,
in_units
=
2
,
activation
=
'tanh'
))
self
.
dropout
=
nn
.
Dropout
(
dropout
)
def
forward
(
self
,
feat
,
pseudo
):
def
forward
(
self
,
feat
,
pseudo
):
h
=
feat
h
=
feat
for
i
in
range
(
len
(
self
.
layers
)):
for
i
in
range
(
len
(
self
.
layers
)):
if
i
>
0
:
h
=
self
.
dropout
(
h
)
h
=
self
.
layers
[
i
](
h
=
self
.
layers
[
i
](
self
.
g
,
h
,
self
.
pseudo_proj
[
i
](
pseudo
))
self
.
g
,
h
,
self
.
pseudo_proj
[
i
](
pseudo
))
return
h
return
h
...
@@ -109,6 +114,7 @@ def main(args):
...
@@ -109,6 +114,7 @@ def main(args):
args
.
n_layers
,
args
.
n_layers
,
args
.
pseudo_dim
,
args
.
pseudo_dim
,
args
.
n_kernels
,
args
.
n_kernels
,
args
.
dropout
)
)
model
.
initialize
(
ctx
=
ctx
)
model
.
initialize
(
ctx
=
ctx
)
n_train_samples
=
train_mask
.
sum
().
asscalar
()
n_train_samples
=
train_mask
.
sum
().
asscalar
()
...
...
examples/pytorch/appnp/train.py
View file @
fdd0fe65
...
@@ -43,9 +43,9 @@ def main(args):
...
@@ -43,9 +43,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/cluster_gcn/cluster_gcn.py
View file @
fdd0fe65
...
@@ -59,9 +59,9 @@ def main(args):
...
@@ -59,9 +59,9 @@ def main(args):
n_classes
=
data
.
num_labels
n_classes
=
data
.
num_labels
n_edges
=
data
.
graph
.
number_of_edges
()
n_edges
=
data
.
graph
.
number_of_edges
()
n_train_samples
=
train_mask
.
sum
().
item
()
n_train_samples
=
train_mask
.
int
().
sum
().
item
()
n_val_samples
=
val_mask
.
sum
().
item
()
n_val_samples
=
val_mask
.
int
().
sum
().
item
()
n_test_samples
=
test_mask
.
sum
().
item
()
n_test_samples
=
test_mask
.
int
().
sum
().
item
()
print
(
"""----Data statistics------'
print
(
"""----Data statistics------'
#Edges %d
#Edges %d
...
...
examples/pytorch/gat/train.py
View file @
fdd0fe65
...
@@ -60,9 +60,9 @@ def main(args):
...
@@ -60,9 +60,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/gcn/gcn_mp.py
View file @
fdd0fe65
...
@@ -137,9 +137,9 @@ def main(args):
...
@@ -137,9 +137,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/gcn/train.py
View file @
fdd0fe65
...
@@ -44,9 +44,9 @@ def main(args):
...
@@ -44,9 +44,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/graphsage/graphsage.py
View file @
fdd0fe65
...
@@ -78,9 +78,9 @@ def main(args):
...
@@ -78,9 +78,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/model_zoo/citation_network/run.py
View file @
fdd0fe65
...
@@ -64,9 +64,9 @@ def main(args):
...
@@ -64,9 +64,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/monet/README.md
View file @
fdd0fe65
...
@@ -11,9 +11,14 @@ Dependencies
...
@@ -11,9 +11,14 @@ Dependencies
Results
Results
=======
=======
Node classification on citation networks:
## Citation networks
Run with following (available dataset: "cora", "citeseer", "pubmed")
```
bash
python3 citation.py
--dataset
cora
--gpu
0
```
-
Cora: ~0.816
-
Cora: ~0.816
-
Pubmed: ~0.763
-
Pubmed: ~0.763
Image classification
on MNIST
:
##
Image classification:
-
please refer to
[
model_zoo/geometric
](
../model_zoo/geometric
)
.
-
please refer to
[
model_zoo/geometric
](
../model_zoo/geometric
)
.
\ No newline at end of file
examples/pytorch/sampling/dis_sampling/gcn_cv_sc_train.py
View file @
fdd0fe65
...
@@ -36,9 +36,9 @@ def main(args):
...
@@ -36,9 +36,9 @@ def main(args):
n_classes
=
data
.
num_labels
n_classes
=
data
.
num_labels
n_edges
=
data
.
graph
.
number_of_edges
()
n_edges
=
data
.
graph
.
number_of_edges
()
n_train_samples
=
train_mask
.
sum
().
item
()
n_train_samples
=
train_mask
.
int
().
sum
().
item
()
n_val_samples
=
val_mask
.
sum
().
item
()
n_val_samples
=
val_mask
.
int
().
sum
().
item
()
n_test_samples
=
test_mask
.
sum
().
item
()
n_test_samples
=
test_mask
.
int
().
sum
().
item
()
print
(
"""----Data statistics------'
print
(
"""----Data statistics------'
#Edges %d
#Edges %d
...
...
examples/pytorch/sampling/dis_sampling/gcn_ns_sc_train.py
View file @
fdd0fe65
...
@@ -37,9 +37,9 @@ def main(args):
...
@@ -37,9 +37,9 @@ def main(args):
n_classes
=
data
.
num_labels
n_classes
=
data
.
num_labels
n_edges
=
data
.
graph
.
number_of_edges
()
n_edges
=
data
.
graph
.
number_of_edges
()
n_train_samples
=
train_mask
.
sum
().
item
()
n_train_samples
=
train_mask
.
int
().
sum
().
item
()
n_val_samples
=
val_mask
.
sum
().
item
()
n_val_samples
=
val_mask
.
int
().
sum
().
item
()
n_test_samples
=
test_mask
.
sum
().
item
()
n_test_samples
=
test_mask
.
int
().
sum
().
item
()
print
(
"""----Data statistics------'
print
(
"""----Data statistics------'
#Edges %d
#Edges %d
...
...
examples/pytorch/sampling/gcn_cv_sc.py
View file @
fdd0fe65
...
@@ -161,9 +161,9 @@ def main(args):
...
@@ -161,9 +161,9 @@ def main(args):
n_classes
=
data
.
num_labels
n_classes
=
data
.
num_labels
n_edges
=
data
.
graph
.
number_of_edges
()
n_edges
=
data
.
graph
.
number_of_edges
()
n_train_samples
=
train_mask
.
sum
().
item
()
n_train_samples
=
train_mask
.
int
().
sum
().
item
()
n_val_samples
=
val_mask
.
sum
().
item
()
n_val_samples
=
val_mask
.
int
().
sum
().
item
()
n_test_samples
=
test_mask
.
sum
().
item
()
n_test_samples
=
test_mask
.
int
().
sum
().
item
()
print
(
"""----Data statistics------'
print
(
"""----Data statistics------'
#Edges %d
#Edges %d
...
...
examples/pytorch/sampling/gcn_ns_sc.py
View file @
fdd0fe65
...
@@ -132,9 +132,9 @@ def main(args):
...
@@ -132,9 +132,9 @@ def main(args):
n_classes
=
data
.
num_labels
n_classes
=
data
.
num_labels
n_edges
=
data
.
graph
.
number_of_edges
()
n_edges
=
data
.
graph
.
number_of_edges
()
n_train_samples
=
train_mask
.
sum
().
item
()
n_train_samples
=
train_mask
.
int
().
sum
().
item
()
n_val_samples
=
val_mask
.
sum
().
item
()
n_val_samples
=
val_mask
.
int
().
sum
().
item
()
n_test_samples
=
test_mask
.
sum
().
item
()
n_test_samples
=
test_mask
.
int
().
sum
().
item
()
print
(
"""----Data statistics------'
print
(
"""----Data statistics------'
#Edges %d
#Edges %d
...
...
examples/pytorch/sgc/sgc.py
View file @
fdd0fe65
...
@@ -48,9 +48,9 @@ def main(args):
...
@@ -48,9 +48,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/sgc/sgc_reddit.py
View file @
fdd0fe65
...
@@ -51,9 +51,9 @@ def main(args):
...
@@ -51,9 +51,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
examples/pytorch/tagcn/train.py
View file @
fdd0fe65
...
@@ -42,9 +42,9 @@ def main(args):
...
@@ -42,9 +42,9 @@ def main(args):
#Val samples %d
#Val samples %d
#Test samples %d"""
%
#Test samples %d"""
%
(
n_edges
,
n_classes
,
(
n_edges
,
n_classes
,
train_mask
.
sum
().
item
(),
train_mask
.
int
().
sum
().
item
(),
val_mask
.
sum
().
item
(),
val_mask
.
int
().
sum
().
item
(),
test_mask
.
sum
().
item
()))
test_mask
.
int
().
sum
().
item
()))
if
args
.
gpu
<
0
:
if
args
.
gpu
<
0
:
cuda
=
False
cuda
=
False
...
...
python/dgl/nn/mxnet/softmax.py
View file @
fdd0fe65
...
@@ -152,6 +152,7 @@ def edge_softmax(graph, logits, eids=ALL):
...
@@ -152,6 +152,7 @@ def edge_softmax(graph, logits, eids=ALL):
<NDArray 6x1 @cpu(0)>
<NDArray 6x1 @cpu(0)>
Apply edge softmax on first 4 edges of g:
Apply edge softmax on first 4 edges of g:
>>> edge_softmax(g, edata, nd.array([0,1,2,3], dtype='int64'))
>>> edge_softmax(g, edata, nd.array([0,1,2,3], dtype='int64'))
[[1. ]
[[1. ]
[0.5]
[0.5]
...
...
python/dgl/nn/pytorch/softmax.py
View file @
fdd0fe65
...
@@ -154,6 +154,7 @@ def edge_softmax(graph, logits, eids=ALL):
...
@@ -154,6 +154,7 @@ def edge_softmax(graph, logits, eids=ALL):
[0.3333]])
[0.3333]])
Apply edge softmax on first 4 edges of g:
Apply edge softmax on first 4 edges of g:
>>> edge_softmax(g, edata[:4], th.Tensor([0,1,2,3]))
>>> edge_softmax(g, edata[:4], th.Tensor([0,1,2,3]))
tensor([[1.0000],
tensor([[1.0000],
[0.5000],
[0.5000],
...
...
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