AllScoreConsumer

class AllScoreConsumer(num_entities, num_relations)[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, target, scores)[source]

Consume scores for the given hr_batch.

Return type:

None

Parameters:
  • batch (LongTensor) –

  • target (Literal['head', 'relation', 'tail']) –

  • scores (FloatTensor) –