InverseOutDegreeEdgeWeighting

class InverseOutDegreeEdgeWeighting(**kwargs)[source]

Bases: EdgeWeighting

Normalize messages by inverse 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: Tensor, target: Tensor, message: Tensor | None = None, x_e: Tensor | None = None) Tensor[source]

Compute edge weights.

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

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

  • message (Tensor | None) – shape (num_edges, dim) Actual messages to weight

  • x_e (Tensor | None) – shape (num_nodes, dim) Node states up to the weighting point

Returns:

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

Return type:

Tensor