torch_geometric_signed_directed.data.signed.SSBM ================================================ .. py:module:: torch_geometric_signed_directed.data.signed.SSBM Functions --------- .. autoapisummary:: torch_geometric_signed_directed.data.signed.SSBM.SSBM torch_geometric_signed_directed.data.signed.SSBM.fill Module Contents --------------- .. py:function:: SSBM(n: int, k: int, pin: float, etain: float, pout: Optional[float] = None, size_ratio: float = 2, etaout: Optional[float] = 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. :obj:`ones`: Weights are 1. 2. :obj:`"exp"`: Weights are exponentially distributed, with parameter 1. 3. :obj:`"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. .. py:function:: 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.