BlockDecomposition¶
- class BlockDecomposition(input_dim, num_relations, num_blocks=None, output_dim=None)[source]¶
Bases:
pykeen.nn.message_passing.Decomposition
Represent relation-specific weight matrices via block-diagonal matrices.
Initialize the layer.
- Parameters
Methods Summary
forward
(x, node_keep_mask, source, target, …)Relation-specific message passing from source to target.
Reset the parameters of this layer.
Methods Documentation
- forward(x, node_keep_mask, source, target, edge_type, edge_weights=None)[source]¶
Relation-specific message passing from source to target.
- Parameters
x (
FloatTensor
) – shape: (num_nodes, input_dim) The node representations.node_keep_mask (
Optional
[BoolTensor
]) – shape: (num_nodes,) The node-keep mask for self-loop dropout.source (
LongTensor
) – shape: (num_edges,) The source indices.target (
LongTensor
) – shape: (num_edges,) The target indices.edge_type (
LongTensor
) – shape: (num_edges,) The edge types.edge_weights (
Optional
[FloatTensor
]) – shape: (num_edges,) Precomputed edge weights.
- Return type
FloatTensor
- Returns
shape: (num_nodes, output_dim) The enriched node embeddings.