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

bug in model.predict() with s and s.item() #63

Open JuliaGast opened 2 years ago

JuliaGast commented 2 years ago

This (l.232 ff):

            for s, prob_s in zip(subjects, prob_subjects):
                if s in s_done:
                    continue
                else:
                    s_done.add(s)

and this:

            for o, prob_o in zip(objects, prob_objects):
                if o in o_done:
                    continue
                else:
                    o_done.add(o)

does not return a true for the if-statement. because e.g., tensor(53) is not equal to tensor(53) - these are different hashs. Instead, you'd have to modify it to

            for s, prob_s in zip(subjects, prob_subjects):
                if s.item() in s_done:
                    continue
                else:
                    s_done.add(s.item())

(and same for objects)

woojeongjin commented 2 years ago

Thanks for the bug! But it does not change the inference.