"...source/git@developer.sourcefind.cn:OpenDAS/fairscale.git" did not exist on "3dcc9eff058cd28250c7a3ab46aaa954abaf5a09"
Commit ff928126 authored by GaiYu0's avatar GaiYu0 Committed by Minjie Wang
Browse files

remove pytorch dependency in sbm.py (#107)

parent 9fd94b53
...@@ -6,7 +6,6 @@ import numpy as np ...@@ -6,7 +6,6 @@ import numpy as np
import numpy.random as npr import numpy.random as npr
import scipy as sp import scipy as sp
import networkx as nx import networkx as nx
from torch.utils.data import Dataset
from .. import backend as F from .. import backend as F
from ..batched_graph import batch from ..batched_graph import batch
...@@ -53,7 +52,7 @@ def sbm(n_blocks, block_size, p, q, rng=None): ...@@ -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() adj = sp.sparse.triu(a) + sp.sparse.triu(a, 1).transpose()
return adj return adj
class SBMMixture(Dataset): class SBMMixture:
""" Symmetric Stochastic Block Model Mixture """ 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. 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): ...@@ -76,7 +75,6 @@ class SBMMixture(Dataset):
""" """
def __init__(self, n_graphs, n_nodes, n_communities, def __init__(self, n_graphs, n_nodes, n_communities,
k=2, avg_deg=3, p='Appendix C', rng=None): k=2, avg_deg=3, p='Appendix C', rng=None):
super(SBMMixture, self).__init__()
self._n_nodes = n_nodes self._n_nodes = n_nodes
assert n_nodes % n_communities == 0 assert n_nodes % n_communities == 0
block_size = n_nodes // n_communities block_size = n_nodes // n_communities
......
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