Lre¶
- class linear_relational.Lre(relation, subject_layer, object_layer, object_aggregation, weight, bias, metadata=None)[source]¶
Linear Relational Embedding
- bias¶
- forward(subject_activations, normalize=False)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- metadata = None¶
- object_aggregation¶
- object_layer¶
- relation¶
- subject_layer¶
- weight¶
- class linear_relational.LowRankLre(relation, subject_layer, object_layer, object_aggregation, u, s, v, bias, metadata=None)[source]¶
Low-rank approximation of a LRE
- bias¶
- forward(subject_activations, normalize=False)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- metadata = None¶
- object_aggregation¶
- object_layer¶
- property rank¶
- relation¶
- s¶
- subject_layer¶
- u¶
- v¶
- class linear_relational.InvertedLre(relation, subject_layer, object_layer, object_aggregation, u, s, v, bias, metadata=None)[source]¶
Low-rank inverted LRE, used for calculating subject activations from object activations
- bias¶
- forward(object_activations, normalize=False)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- metadata = None¶
- object_aggregation¶
- object_layer¶
- property rank¶
- relation¶
- s¶
- subject_layer¶
- u¶
- v¶