GraphConv(in_channels, out_channels, aggr='mean', bias=True, **kwargs)

Bases: MessagePassing

Basic graph convolution layer with center node handling.

Parameters:
  • in_channels (int) –

    Number of input channels

  • out_channels (int) –

    Number of output channels

  • aggr (str, default: 'mean' ) –

    Aggregation method ('mean', 'add', etc.). Default: 'mean'

  • bias (bool, default: True ) –

    Whether to include bias. Default: True

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

    Additional arguments for MessagePassing

Notes

Performs message passing with:

  • Linear transformation of source nodes
  • Separate transformation for center nodes
  • Message aggregation
forward(x, edge_index, x_cen)

Forward pass of the layer.

Parameters:
  • x (Tensor) –

    Input node features

  • edge_index (Tensor) –

    Edge indices

  • x_cen (Tensor) –

    Center node features

Returns:
  • Tensor

    Updated node features

MixUpGCNConv(in_channels, out_channels, improved=False, cached=False, add_self_loops=False, normalize=True, bias=True, **kwargs)

Bases: MessagePassing

Graph convolutional operator with mixup capabilities.

Parameters:
  • in_channels (int) –

    Number of input channels

  • out_channels (int) –

    Number of output channels

  • improved (bool, default: False ) –

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

  • cached (bool, default: False ) –

    Whether to cache normalized adjacency matrix. Default: False

  • add_self_loops (bool, default: False ) –

    Whether to add self-loops to input graph. Default: False

  • normalize (bool, default: True ) –

    Whether to apply symmetric normalization. Default: True

  • bias (bool, default: True ) –

    Whether to include bias. Default: True

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

    Additional arguments for MessagePassing

forward(x, x_cen, edge_index, edge_weight=None, lmda=1)

Forward pass with mixup interpolation.

Parameters:
  • x (Tensor) –

    Input node features

  • x_cen (Tensor) –

    Center node features

  • edge_index (Tensor or SparseTensor) –

    Edge indices

  • edge_weight (Tensor, default: None ) –

    Edge weights. Default: None

  • lmda (float, default: 1 ) –

    Mixup interpolation coefficient. Default: 1

Returns:
  • Tensor

    Updated node features with mixup

Notes
  • Graph normalization (if enabled)
  • Linear transformation
  • Message passing with mixup
  • Center node transformation
  • Optional bias addition
message(x_j, edge_weight, lmda, edge_rw)

Define message computation.

Parameters:
  • x_j (Tensor) –

    Source node features

  • edge_weight (Tensor) –

    Normalized edge weights

  • lmda (float) –

    Mixup interpolation coefficient

  • edge_rw (Tensor) –

    Raw edge weights for reweighting

Returns:
  • Tensor

    Computed messages with mixup interpolation

Notes

Interpolates between normalized and reweighted messages: message = (1-lambda) * normalized + lambda * reweighted