RelationLossWeighter
- class RelationLossWeighter(weights: Tensor)[source]
Bases:
LossWeighter
Determine loss weights based solely on the relation.
Initialize the weighter.
- Parameters:
weights (Tensor) – shape:
(num_relations,)
The weight per relation.
Methods Summary
__call__
(h, r, t)Calculate the sample weights for the given triples.
inverse_relation_frequency
(mapped_triples)Create a loss weighter with inverse relation frequencies.
Methods Documentation