SymmetricEdgeWeighting

class SymmetricEdgeWeighting(**kwargs)[source]

Bases: pykeen.nn.weighting.EdgeWeighting

Normalize messages by product of inverse sqrt of in-degree and out-degree.

Initializes internal Module state, shared by both nn.Module and ScriptModule.

Methods Summary

forward(source, target[, message, x_e])

Compute edge weights.

Methods Documentation

forward(source, target, message=None, x_e=None)[source]

Compute edge weights.

Parameters
  • source (LongTensor) – shape: (num_edges,) The source indices.

  • target (LongTensor) – shape: (num_edges,) The target indices.

  • message (Optional[FloatTensor]) – shape (num_edges, dim) Actual messages to weight

  • x_e (Optional[FloatTensor]) – shape (num_nodes, dim) Node states up to the weighting point

Return type

FloatTensor

Returns

shape: (num_edges, dim) Messages weighted with the edge weights.