I am trying to apply this model to some other datasets. I found that at times the model gives no predictions.
I found that it might be happening due to setting the relation logit output shape to num_classes+1
self.decoder2class = nn.Linear(config.hidden_size, num_classes + 1)
and then not creating triples when relation predicted was equal to num_classes
def generate_strategy(pred_rel, pred_head, pred_tail, num_classes, _Pred_Triple):
if pred_rel.pred_rel != num_classes:
Can somebody help me understand why this is done this way?
I am trying to apply this model to some other datasets. I found that at times the model gives no predictions.
I found that it might be happening due to setting the relation logit output shape to num_classes+1
self.decoder2class = nn.Linear(config.hidden_size, num_classes + 1)
and then not creating triples when relation predicted was equal to num_classes
def generate_strategy(pred_rel, pred_head, pred_tail, num_classes, _Pred_Triple):
if pred_rel.pred_rel != num_classes:
Can somebody help me understand why this is done this way?