A2GNNBase(in_dim, hid_dim, num_classes, num_layers=1, adv=False, dropout=0.1, act=F.relu, mode='node', **kwargs)
Bases: Module
Base class for A2GNN.
| Parameters: |
|
|---|
domain_classifier(x, alpha)
Domain classification with gradient reversal.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
- Applies gradient reversal layer
- Binary domain classification
- Used only when adv=True
- Helps in domain adaptation
feat_bottleneck(x, edge_index, batch, prop_nums=30)
Feature extraction through propagation layers.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Implementation features:
- Multiple GCN layers with propagation
- Activation and dropout after each layer
- Graph pooling for graph-level tasks
- Configurable propagation steps
feat_classifier(x, edge_index, batch, prop_nums=1)
Classification layer with propagation.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
- Node-level: Uses PropGCNConv with propagation
- Graph-level: Uses linear classification
- Single propagation step by default
forward(data, prop_nums)
Forward pass of the A2GNN model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
-
Handles both node and graph-level tasks
-
Two-stage processing:
- Feature bottleneck with multiple propagations
- Classification with single propagation