JHGDA(in_dim, hid_dim, num_classes, num_layers=3, dropout=0.0, act=F.relu, weight_decay=0.0, share=False, sparse=False, classwise=True, pool_ratio=0.2, g_mmd=0.5, c_mmd=0.5, d_weight=0.1, ce_weight=0.1, prox_weight=0.1, cce_weight=0.1, lm_weight=0.1, ls_weight=0.1, lr=0.004, epoch=200, device='cuda:0', batch_size=0, num_neigh=-1, verbose=2, **kwargs)
Bases: BaseGDA
Improving Graph Domain Adaptation with Network Hierarchy (CIKM-23).
| Parameters: |
|
|---|
fit(source_data, target_data)
Train the JHGDA model on source and target domain data.
| Parameters: |
|
|---|
Notes
Training process includes:
Data preparation:
- Sets up data loaders for batch processing
- Handles both full-batch and mini-batch scenarios
- Stores source and target graph sizes
Model setup:
- Initializes JHGDA model
- Configures Adam optimizer with weight decay
Training loop:
- Performs forward pass with hierarchical adaptation
- Updates model parameters
-
Tracks and logs training metrics:
- Loss values
- Source domain accuracy
- Training time
forward_model(source_data, target_data)
Forward pass of the JHGDA model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Computes multiple loss terms:
Source domain cross-entropy loss
Domain adaptation losses:
- Global MMD loss across layers
- Classwise conditional MMD loss
Hierarchical structure losses:
- Conditional cluster entropy (cce)
- Label matching (lm)
- Label stability (ls)
- Cluster entropy (ce)
- Proximity loss (prox)
init_model(**kwargs)
Initialize the JHGDA model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Configures the base model with hierarchical graph structure parameters:
- Pooling ratio for graph coarsening
- Sharing settings for diffpool module
- Sparsity options for efficiency
- Classwise conditional adaptation settings
predict(data)
Make predictions on given data.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Uses the model's inference mode for prediction, which may involve hierarchical graph processing.
process_graph(data)
Process the input graph data.
| Parameters: |
|
|---|
Notes
Placeholder method for graph preprocessing.