INK-USC / RE-Net

Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs (EMNLP 2020)
http://inklab.usc.edu/renet/
435 stars 95 forks source link

Something strange in your inference code!! #34

Closed Lee-zix closed 3 years ago

Lee-zix commented 3 years ago

In the line 224 of model.py , you use global_emb_prev_t, sub, prob_sub = global_model.predict(t, self.graphdict, subject=True) to get H{t-1} and s_t (according to you notes in the line 81 of global_model.py # Predict s at time t, so <t-1 graphs are used.) then you sample G_t and add to s_his_cache and o_his_cache, and in the line 301-302 of model.py, self.data = get_data(self.s_his_cache, self.o_his_cache) self.graph_dict[self.latest_time.item()] = get_big_graph(self.data, self.num_rels) you add G_t to graph_dict.

I think the line 302 of model.py should be: self.graph_dict[t] = get_big_graph(self.data, self.num_rels)

And why you add the sampled G_t to history when predicting (s_t, r_t, ??)

Are these codes the version of your EMNLP2020 paper?? Is there some misunderstanding of your codes?

Thanks very much for your reply!

woojeongjin commented 3 years ago

Hi,

To predict (s_t,r_t, ??), graph_dict[t-1] (latest_time=t-1) should be used not graph_dict[t]. In the inference time, two things are done: building (or sampling) graphs until t-1, and based on the sampled graphs, predict (s_t, r_t, ??) at time t.

If you have another question, please leave a comment!

Lee-zix commented 3 years ago

Thanks very much for your reply!!! It helps a lot!