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
ff928126
Commit
ff928126
authored
Oct 26, 2018
by
GaiYu0
Committed by
Minjie Wang
Oct 25, 2018
Browse files
remove pytorch dependency in sbm.py (#107)
parent
9fd94b53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
python/dgl/data/sbm.py
python/dgl/data/sbm.py
+1
-3
No files found.
python/dgl/data/sbm.py
View file @
ff928126
...
...
@@ -6,7 +6,6 @@ import numpy as np
import
numpy.random
as
npr
import
scipy
as
sp
import
networkx
as
nx
from
torch.utils.data
import
Dataset
from
..
import
backend
as
F
from
..batched_graph
import
batch
...
...
@@ -53,7 +52,7 @@ def sbm(n_blocks, block_size, p, q, rng=None):
adj
=
sp
.
sparse
.
triu
(
a
)
+
sp
.
sparse
.
triu
(
a
,
1
).
transpose
()
return
adj
class
SBMMixture
(
Dataset
)
:
class
SBMMixture
:
""" Symmetric Stochastic Block Model Mixture
Please refer to Appendix C of "Supervised Community Detection with Hierarchical Graph Neural Networks" (https://arxiv.org/abs/1705.08415) for details.
...
...
@@ -76,7 +75,6 @@ class SBMMixture(Dataset):
"""
def
__init__
(
self
,
n_graphs
,
n_nodes
,
n_communities
,
k
=
2
,
avg_deg
=
3
,
p
=
'Appendix C'
,
rng
=
None
):
super
(
SBMMixture
,
self
).
__init__
()
self
.
_n_nodes
=
n_nodes
assert
n_nodes
%
n_communities
==
0
block_size
=
n_nodes
//
n_communities
...
...
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