SymmetricEdgeWeighting

class SymmetricEdgeWeighting(**kwargs)[source]

Bases: EdgeWeighting

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

Initialize the module.

Parameters:

kwargs – ignored keyword-based parameters.

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.