- predict_r_uncertain(model, ht_batch, num_samples=5, slice_size=None, *, mode=None)¶
Forward pass using middle (relation) prediction for obtaining scores of all possible relations.
This method calculates the score for all possible relations for each (head, tail) pair, as well as an uncertainty quantification.
Model) – the model used for predicting scores
LongTensor) – shape: (batch_size, 2) The indices of (head, tail) pairs.
int) – >1 the number of samples to draw
- Return type:
shape: (batch_size, num_relations) For each h-t pair, the scores for all possible relations.
This function sets the model to evaluation mode and all dropout layers to training mode.