torch_geometric_signed_directed.data.signed.SSBM

Functions

SSBM(→ Tuple[Tuple[scipy.sparse.spmatrix, ...)

A signed stochastic block model graph generator from the

fill(→ float)

A filling method for the signed stochastic block model graph generator from the

Module Contents

SSBM(n: int, k: int, pin: float, etain: float, pout: float | None = None, size_ratio: float = 2, etaout: float | None = None, values: str = 'ones') Tuple[Tuple[scipy.sparse.spmatrix, scipy.sparse.spmatrix], numpy.array]

A signed stochastic block model graph generator from the SSSNET: Semi-Supervised Signed Network Clustering paper.

Arg types:
  • n (int) - Number of nodes.

  • k (int) - Number of communities.

  • pin (float) - Sparsity value within communities.

  • etain (float) - Noise value within communities.

  • pout (float) - Sparsity value between communities.

  • etaout (float) - Noise value between communities.

  • size_ratio (float) - The communities have number of nodes multiples of each other, with the largest size_ratio times the number of nodes of the smallest.

  • values (string) - Edge weight distribution (within community and without sign flip; otherwise weight is negated):

    1. ones: Weights are 1.

    2. "exp": Weights are exponentially distributed, with parameter 1.

    3. "uniform": Weights are uniformly distributed between 0 and 1.

Return types:
  • A_p (sp.spmatrix) - A sparse adjacency matrix for the positive part.

  • A_n (sp.spmatrix) - A sparse adjacency matrix for the negative part.

  • labels (np.array) - Labels.

fill(values: str = 'ones') float

A filling method for the signed stochastic block model graph generator from the SSSNET: Semi-Supervised Signed Network Clustering” paper. Arg types:

  • values (string): Edge weight:

    ‘ones’: Weights are 1.

    ‘exp’: Weights are exponentially distributed, with parameter 1.

    ‘uniform: Weights are uniformly distributed between 0 and 1.

Return types:
  • value (float): A filled value.