Open chengaojie0011 opened 4 years ago
I am also interested to that question. Have you tried to randomly assign self.A_in and then try to call _create_xxx_embed() again to generate ua_embeddings, ea_embeddings?
Sorry for the late reply after the busy weeks.
Hope this is helpful for you @chengaojie0011 @johnnyjana730 .
Sorry for the late reply after the busy weeks.
- Please distinguish the self.A_values, which is set as a placeholder, and self.A_in, which is used to feed the values of self.A_values.
- I have tested the code and show the value in self.A_in (the first 20 values for limited space) in the following picture. As the figure shows, the self.A_in is updated as the epoch increases.
Hope this is helpful for you @chengaojie0011 @johnnyjana730 .
Many thanks for your kind reply. The value of self.A_in has updated in class KGAT(object), but it doesn't update in the model because Tensorflow builds a static graph before a model can run. I'm not sure If I've explained this problem clearly. If you try to replace self.A_in with any value, you may find the model will still work, and the results of the model also not change.
I have tested three variants, setting self.A_in's values as all zeros, all ones, and random values. The training performance is shown as follows:
all-ones
all-zeros
randoms
Some observations:
Hope this is helpful. Thanks for your insightful comments.
I think @chengaojie0011 is right. Because self.A_in
is not a placeholder in graph, the assignment will not work, and never affect the network.
https://github.com/xiangwang1223/knowledge_graph_attention_network/blob/c03737be46ac26a0b5431efe149828e982ffbbfb/Model/KGAT.py#L465-L466
if you set this exactly self.A_in
to zero or one, the performance of the model will stay unchanged.
Thank you for offering the code of KGAT paper, and it helps me a lot. In running code, I found that the function (model.update_attentive_A) use self.A_in to update the matrix A. But as far as I know, TensorFlow cannot change the value of the variable in the static graph in this way. I found experimentally that whatever self.A_in is assigned, it doesn't change the result of the model. If so, KGAT does not use dynamic weights to implement GAT. Look forward to your reply.