Closed Void-JackLee closed 1 year ago
Thank you for your interest and the very clear description of these issues!
csr_array
instead of spmatrix
: When I created this repository, csr_array
didn't even exist. The function's behavior is actually consistent with the type annotation, which specifies sp.spmatrix
as input type. Regardless, I've extended the function to sp.sparray
, so it works more smoothly.networkx_to_sparsegraph
is just a utility function and is not used in the demo. I hope you found it useful despite the issues!
I'm using torch for training, and I try to convert a dataset to sparsegraph defined in project, it raise me an error with numpy.
Finally I find that bug in networkx_to_sparsegraph function.
The type of adj_matrix privide here was
scipy.sparse._arrays.csr_array
, not the sparse matrix!Thus,
np.sum(A, axis=1)
will produce anumpy.ndarray
object which has no attribute 'A1', onlynumpy.matrix
has it. Actually, it's easy to fix it withtry...except
block. I modify thecalc_A_hat(adj_matrix)
function in propagation.py as below. 😊Another bug is the labels. In function
train_stopping_split
, thefor i in range(max(labels) + 1):
statement needs a integer labels.But actully the type of labels produced by
networkx_to_sparsegraph
function isfloat32
!Just modify it to
integer
can fix this problem. 😊