AllScoreConsumer

class AllScoreConsumer(num_entities: int, num_relations: int)[source]

Bases: ScoreConsumer

Collect scores for all triples.

Initialize the consumer.

Parameters:
  • num_entities (int) – the number of entities

  • num_relations (int) – the number of relations

Attributes Summary

flatten

Methods Summary

__call__(batch, target, scores)

Consume scores for the given hr_batch.

Attributes Documentation

flatten: bool = True

Methods Documentation

__call__(batch: Tensor, target: Literal['head', 'relation', 'tail'], scores: Tensor) None[source]

Consume scores for the given hr_batch.

Parameters:
Return type:

None