KBL(in_dim, hid_dim, num_classes, k_cross=50, k_within=10, num_layers=2, dropout=0.0, act=F.relu, weight_decay=0.005, lr=0.001, epoch=200, device='cuda:0', batch_size=0, num_neigh=-1, verbose=2, **kwargs)
Bases: BaseGDA
Bridged-GNN: Knowledge Bridge Learning for Effective Knowledge Transfer (CIKM-23).
| Parameters: |
|
|---|
fit(source_data, target_data)
Train the KBL model on source and target domain data.
| Parameters: |
|
|---|
Notes
Training process includes:
Data preparation:
- Stores source and target data for bridge construction
- Creates data loaders (full batch only)
Bridge construction:
- Builds knowledge bridge between domains
- Creates unified graph with cross-domain connections
- Converts to undirected graph structure
Training loop:
- Processes merged graph with knowledge bridges
- Updates model parameters using central nodes
-
Tracks and logs:
- Classification loss
- Training accuracy
- Computation time
Important
Only supports full-batch training (batch_size must be 0)
forward_model(source_data, target_data)
Forward pass of the model.
| Parameters: |
|
|---|
Notes
Placeholder method as the main forward logic is handled in the fit method through bridged graph processing.
init_model(**kwargs)
Initialize the Knowledge Bridge Learning (KBL) model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Configures the base model with specific parameters:
- Bridge construction parameters (k_cross, k_within)
- Model architecture (hidden dimensions, layers)
- Training settings (learning rate, weight decay)
- Normalization options
predict(data)
Make predictions on given data.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Uses the stored bridged graph for inference, extracting predictions for the target nodes.
process_graph(data)
Process the input graph data.
| Parameters: |
|
|---|
Notes
Placeholder method for graph preprocessing.