PPMIConv(in_channels, out_channels, weight=None, bias=None, improved=False, use_bias=True, path_len=5, **kwargs)

Bases: CachedGCNConv

Graph convolution layer using Pointwise Mutual Information (PPMI) for edge weighting.

Parameters:
  • in_channels (int) –

    Number of input channels

  • out_channels (int) –

    Number of output channels

  • weight (Tensor, default: None ) –

    Pre-defined weight matrix. Default: None

  • bias (Tensor, default: None ) –

    Pre-defined bias vector. Default: None

  • improved (bool, default: False ) –

    If True, uses A + 2I for self-loops. Default: False

  • use_bias (bool, default: True ) –

    Whether to include bias. Default: True

  • path_len (int, default: 5 ) –

    Maximum length of random walks. Default: 5

  • **kwargs (optional, default: {} ) –

    Additional arguments for CachedGCNConv

Notes

Implements PPMI-based graph convolution by:

  • Generating random walks to estimate node co-occurrences
  • Computing PPMI scores for edge weights
  • Applying normalized convolution with PPMI weights
norm(edge_index, num_nodes, edge_weight=None, improved=False, dtype=None)

Compute PPMI-based normalized adjacency matrix.

Parameters:
  • edge_index (Tensor) –

    Edge indices (2 x E)

  • num_nodes (int) –

    Number of nodes in the graph

  • edge_weight (Tensor, default: None ) –

    Initial edge weights. Default: None

  • improved (bool, default: False ) –

    If True, uses A + 2I for self-loops. Default: False

  • dtype (dtype, default: None ) –

    Data type for computations. Default: None

Returns:
  • tuple[Tensor, Tensor]

    Contains:

    • Modified edge indices
    • PPMI-based normalized edge weights
Notes
  • Build adjacency dictionary
  • Generate random walks
  • Compute normalized co-occurrence probabilities
  • Calculate PPMI scores
  • Apply symmetric normalization

The PPMI computation follows: PPMI(a,b) = max(log(P(a,b)/(P(a)P(b)) * N/path_len), 0) where:

  • P(a,b) is co-occurrence probability
  • P(a), P(b) are marginal probabilities
  • N is number of nodes