flyingdoog / PGExplainer

Parameterized Explainer for Graph Neural Network
123 stars 15 forks source link

Disconnected motifs in BAMotifs #10

Open steveazzolin opened 2 years ago

steveazzolin commented 2 years ago

Hello,

I was playing around with train_BA-2motif.ipynb when I realized that some input graphs are not as expected. Specifically, by running this code after the cell where you read the dataset:

for i in adjs:
    d = nx.from_numpy_array(i)
    if not (nx.is_connected(d)):
        nx.draw(d)
        plt.show()

I saw that there are about 40 graphs that are disconnected and in which the target motif has a self-loop. This behavior is unexpected after reading the dataset description of the original paper.

image

apurvakokate commented 2 years ago

Related to this: the paper mentions a connectivity constraint applied as cross entropy of adjacent edges but I cannot find the implementation in the code. cc: @flyingdoog

steveazzolin commented 2 years ago

@apurva94 I believe you can find it in /codes/forgraph/Explainer.py Btw to me is not clear to which implementation we should refer to between /codes/forgraph/Explainer.py and /codes/Explainer.py