Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCNMultiDecoder doesn't use label graph when output_type is "open" #4

Open
Saltychtao opened this issue May 11, 2019 · 0 comments
Open

Comments

@Saltychtao
Copy link

Hi, thanks for sharing code ! I notice that in the forward function of class GCNMultiDecoder in model_util.py

def forward(self, inputs, output_type):
    connection_matrix = self.label_matrix + self.weight * self.affinity
    label_vectors = self.transform(
        connection_matrix.mm(self.linear.weight) / connection_matrix.sum(
            1, keepdim=True))

    if output_type == "open":
        return self.linear(inputs)
    elif output_type == 'wiki':
        return F.linear(
            inputs, label_vectors[:constant.ANSWER_NUM_DICT['wiki'], :],
            self.linear.bias)
    elif output_type == 'kb':
        return F.linear(inputs,
                        label_vectors[:constant.ANSWER_NUM_DICT['kb'], :],
                        self.linear.bias)
    else:
        raise ValueError('Decoder error: output type not one of the valid')

when output_type is "open", the model simply do a linear transform of the input hidden state which means the model doesn't utilize the label correlation information when the label space is "open", is there something wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant