GRADE(in_dim, hid_dim, num_classes, mode='node', num_layers=2, dropout=0.0, act=F.relu, disc='JS', weight=0.01, weight_decay=0.01, lr=0.001, epoch=200, device='cuda:0', batch_size=0, num_neigh=-1, verbose=2, **kwargs)
Bases: BaseGDA
Non-IID Transfer Learning on Graphs (AAAI-23).
| Parameters: |
|
|---|
fit(source_data, target_data)
Train the GRADE model.
| Parameters: |
|
|---|
Notes
Training process includes:
- Setting up appropriate data loaders based on mode (node/graph)
- Initializing model and optimizer
- Training with dynamic gradient reversal parameter
- Supporting both node-level and graph-level tasks
- Computing and logging training metrics
forward_model(source_data, target_data, alpha)
Forward pass of the model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
Computes multiple loss terms:
- Cross entropy loss for source domain
- Domain adaptation loss (JS-divergence, MMD, or Conditional)
- Weighted combination of both losses
init_model(**kwargs)
Initialize the GRADE model.
| Parameters: |
|
|---|
| Returns: |
|
|---|
predict(data, source=False)
Make predictions on given data.
| Parameters: |
|
|---|
| Returns: |
|
|---|
Notes
- Uses appropriate data loader based on domain (source/target)
- Returns both logits and ground truth labels
- Handles batched predictions for large graphs
process_graph(data)
Process the input graph data.
| Parameters: |
|
|---|
Notes
Placeholder method for graph preprocessing.