torch_geometric_signed_directed.data.general.SDSBM ================================================== .. py:module:: torch_geometric_signed_directed.data.general.SDSBM Functions --------- .. autoapisummary:: torch_geometric_signed_directed.data.general.SDSBM.SDSBM Module Contents --------------- .. py:function:: SDSBM(N: int, K: int, p: float, F: numpy.array, size_ratio: float = 1, eta: float = 0.1) -> Tuple[scipy.sparse.spmatrix, numpy.array] A signed directed stochastic block model graph generator from the `MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian `_ paper. Arg types: * **N** (int) - Number of nodes. * **K** (int) - Number of clusters. * **p** (float) - Sparsity value, edge probability. * **F** (np.array) - The meta-graph adjacency matrix to generate edges. * **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. A geometric sequence is generated to denote the node size of each cluster based on the size_ratio. * **eta** (float) - Sign flip probability. Return types: * **a** (sp.csr_matrix) - a is a sparse N by N matrix of the edges. * **c** (np.array) - c is an array of cluster membership.