NodeCentricConv(in_channels, out_channels, model_weights=(), lamb=0.2, aggr='mean', **kwargs)
Bases: MessagePassing
Node-centric graph convolution layer.
This layer implements a node-centric message passing mechanism with attention and weight-based feature transformation. It combines neighbor aggregation with learnable attention mechanisms and feature transformations.
| Parameters: |
|
|---|
| Attributes: |
|
|---|
Notes
The forward pass consists of several steps:
- Adds self-loops to the input graph
- Aggregates neighbor features
- Applies feature transformation with attention mechanism
- Combines transformed features with base transformation
forward(x, edge_index, edge_type=None)
Forward pass of the layer.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
The forward pass performs these operations:
- Adds self-loops to edge_index
- Aggregates neighbor features using SimpleConv
- Applies multiple feature transformations with attention
- Combines transformed features with base transformation
message(x_j, gamma_i, edge_weight)
Compute messages between nodes.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
The message function performs element-wise multiplication between source node features and transformation coefficients.
NodeCentricMLP(num_classes, model_list)
Bases: Module
Node-centric multi-layer perceptron.
This module implements a node-centric MLP with attention-based model ensemble.
| Parameters: |
|
|---|
| Attributes: |
|
|---|
forward(x, edge_index, edge_weight=None)
Forward pass of the module.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Sparsemax(dim=0)
Bases: Module
Sparsemax activation function module.
A sparse alternative to softmax that produces sparse probability distributions.
| Parameters: |
|
|---|
SparsemaxFunction
Bases: Function
Custom autograd function for sparsemax operation.
Implements the forward and backward passes for the sparsemax normalization, which is a sparse alternative to softmax.
backward(ctx, grad_output)
staticmethod
Backward pass of sparsemax.
| Parameters: |
|
|---|
| Returns: |
|
|---|
forward(ctx, input, dim=0)
staticmethod
Forward pass of sparsemax.
| Parameters: |
|
|---|
| Returns: |
|
|---|