Extremely-Fine-Grained-Entity-Typing
Extremely-Fine-Grained-Entity-Typing copied to clipboard
GCNMultiDecoder doesn't use label graph when output_type is "open"
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?