MIRALab-USTC / KG-TACT

The code of paper Topology-Aware Correlations Between Relations for Inductive Link Prediction in Knowledge Graphs. Jiajun Chen, Huarui He, Feng Wu, Jie Wang. AAAI 2021.
39 stars 7 forks source link

About the ablation study #10

Open Bohemianc opened 2 years ago

Bohemianc commented 2 years ago

Hi, I am interested in your work and I think the design of the relational correlation module is very clever. I have a question about the experiment in your paper.

There are three variants of TACT mentioned in Section 4.

And I found the code segment for the ablation study as follows, which is in model/dgl/graph_classifier.py.

        if self.no_jk:
            if self.params.ablation == 0:
                g_rep = torch.cat([g_out.view(-1, self.params.emb_dim),
                                   head_embs.view(-1, self.params.emb_dim),
                                   tail_embs.view(-1, self.params.emb_dim),
                                   rel_final_emb], dim=1)
            elif self.params.ablation == 1:  # no-subg
                g_rep = torch.cat([head_embs.view(-1, self.params.emb_dim),
                                   tail_embs.view(-1, self.params.emb_dim),
                                   rel_final_emb], dim=1)
            elif self.params.ablation == 2:  # no-ent
                g_rep = torch.cat([g_out.view(-1, self.params.emb_dim),
                                   rel_final_emb], dim=1)
            elif self.params.ablation == 3:  # only-rel
                g_rep = torch.cat([rel_final_emb], dim=1)
        else:
            g_rep = torch.cat([g_out.view(-1, self.params.num_gcn_layers * self.params.emb_dim),
                               head_embs.view(-1, self.params.num_gcn_layers * self.params.emb_dim),
                               tail_embs.view(-1, self.params.num_gcn_layers * self.params.emb_dim),
                               rel_final_emb], dim=1)

I want to know the relations about the variants and the values of parameter ablation. I found TACT-base corresponds to the case ablation == 3, but the code for ablation==1 and ablation==2 is inconsistent with the description in the paper for the variants TACT w/o RA and TACT w/o RC. Where is the code for the two variants? Or did I misunderstand the two variants?

Thanks.