snap-stanford / csr

Apache License 2.0
31 stars 7 forks source link

Question about the M_p and M_e #2

Closed RManLuo closed 1 year ago

RManLuo commented 1 year ago

Hi, thanks for your inspiring work! However, I found some details in the paper hard to follow. Could you help to answer some questions for me?

Q1. How is M_p defined? In Eq 12, you provide the realization of M_p. Why optimizing Eq 12 can output masks that represent the largest common connection subgraph? How can we arg max a $m_i$? How can we $\sum({mi}{i=1}^K)$ when the subgraphs are different for support triplet? How can we have $m_q$ during the generation of $m_i$? Could you refer to a code segment for a better explanation?

Q2. How is M_e defined? I think the T in Eq 14 should be the Me? How can the $f{DEC}$ generate $m_q$? Does it output a binary score for each edge in the subgraph as the $m_q$? Could you also refer to a code segment for this?

I am not sure I stated my questions properly. I am really looking forward to your reply.

q-hwang commented 1 year ago

Hi,

Thanks for the questions!

M_p and M_e are two abstract modules and we provide two implementations for them in the paper (i.e. CSR-OPT and CSR-GNN). Eq 12 provides the CSR-OPT implementation of M_p. It essentially maximizes the selected subgraph ($m_i$), under the constraint that all subgraphs represented by $m_i$ should be very close (i.e. cosine similarity > 1- $\epsilon$). We optimizes this objective using gradient descent by relaxing $m_i$ to be continuous while regularizing its entropy to be small. The implementation can be found here https://github.com/snap-stanford/csr/blob/main/models.py#L1000..L1196.

And the CSR-OPT version of Me is defined indeed by Eq 14. $f{DEC}$ outputs a continuous version of $m_q$ in the CSR-GNN implementations using sigmoid: https://github.com/snap-stanford/csr/blob/main/models.py#L324-L334.

Hope this answers your questions!

RManLuo commented 1 year ago

Thanks again for your detailed answers! This code is really helpful for understanding the paper.