working-yuhao / DEAL

IJCAI2020
MIT License
20 stars 6 forks source link

Structure-oriented Encoder #4

Closed xinsheng44 closed 3 years ago

xinsheng44 commented 3 years ago

hello,the formula of structure encoder in this paper is shown in the figure below.

图片

but I read the code, and it is true that the node is directly evaluated nn.embedding. I didn't find the code written according to this formula

` def node_forward(self, nodes):

self.node_emb = nn.Embedding(node_num, emb_dim).to(self.device)

    first_embs = self.node_emb(nodes[:,0])
    sec_embs = self.node_emb(nodes[:,1])
    return self.node_layer(first_embs,sec_embs)

` Is it because the published code is incomplete or I didn't find it? Could you help me find it? i will thank you very much.

working-yuhao commented 3 years ago

Hi,

Sorry for the delay on this one. Yes, you are right. The released code is a simple version that doesn't include the weight normalization. To use it, please refer to https://pytorch.org/docs/stable/generated/torch.nn.utils.weight_norm.html. Actually, the structure-oriented Encoder can be replaced by any other neural network, and we here just propose the simplest example for testing.

kind regards, Yu