torch_geometric_signed_directed.data.directed.DSBM ================================================== .. py:module:: torch_geometric_signed_directed.data.directed.DSBM Functions --------- .. autoapisummary:: torch_geometric_signed_directed.data.directed.DSBM.DSBM Module Contents --------------- .. py:function:: DSBM(N: int, K: int, p: float, F: numpy.array, size_ratio: float = 1) -> Tuple[scipy.sparse.spmatrix, numpy.array] A directed stochastic block model graph generator from the `DIGRAC: Digraph Clustering Based on Flow Imbalance `_ 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. 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.