CWGCN(in_dim, hid_dim, num_classes, mode='node', num_layers=2, dropout=0.0, gnn='gcn', act=F.relu, weight_decay=0.0001, lr=0.001, epoch=200, device='cuda:0', batch_size=0, num_neigh=-1, verbose=2, **kwargs)
Bases: BaseGDA
Correntropy-Induced Wasserstein GCN: Learning Graph Embedding via Domain Adaptation (TIP-2023).
| Parameters: |
|
|---|
fit(source_data, target_data)
Train the CWGCN model in two steps.
| Parameters: |
|
|---|
Notes
Training process consists of two main steps:
Step 1: Source Domain Training
- Initializes data loaders based on mode (node/graph)
- Trains model with correntropy-induced loss
- Updates all model parameters
- Monitors source domain performance
Step 2: Target Domain Adaptation
- Freezes classification layer parameters
- Computes source domain statistics
- Aligns feature distributions
- Minimizes mean and variance discrepancy
- Tracks target domain performance
Implementation Details:
- Supports both node and graph-level tasks
- Handles full-batch and mini-batch processing
- Uses Adam optimizer with weight decay
- Implements comprehensive logging
forward_model(source_data)
Forward pass of the CWGCN model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Handles both node and graph-level tasks with appropriate batch processing.
get_src_mean_std(embedding, weight)
Calculate weighted mean and standard deviation of source embeddings.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Implements:
- Weighted mean computation
- Bias-corrected variance estimation
- Proper normalization with sample weights
init_model(**kwargs)
Initialize the CWGCN base model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Configures model with:
- Selected GNN backbone (gcn, sage, gat, or gin)
- Two-layer architecture
- Mode-specific settings (node/graph)
- Dropout and activation functions
predict(data, source=False)
Make predictions on input data.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
- Handles both node and graph-level predictions
- Processes data in batches if specified
- Concatenates results for full predictions
process_graph(data)
Process the input graph data.
| Parameters: |
|
|---|
Notes
Placeholder method for potential graph preprocessing. Current implementation focuses on direct feature usage.