-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BugFix] Fix missing node normalization for link prediction tasks in …
…multi-task learning (#926) *Issue #, if available:* In multitask learning, when there is a training link prediction task with contrastive loss, the loss may become NaN. This is because, GraphStorm does not add proper node normalization for the gnn embeddings. *Description of changes:* Fix the bug. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Xiang Song <[email protected]>
- Loading branch information
1 parent
f4d5785
commit 1d1b21f
Showing
12 changed files
with
581 additions
and
37 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
inference_scripts/mt_infer/ml_nc_lp_norm_with_mask_infer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
version: 1.0 | ||
gsf: | ||
basic: | ||
backend: gloo | ||
verbose: false | ||
save_perf_results_path: null | ||
batch_size: 32 | ||
node_feat_name: | ||
- user:feat | ||
- movie:title | ||
gnn: | ||
model_encoder_type: rgcn | ||
num_layers: 1 | ||
hidden_size: 32 | ||
use_mini_batch_infer: true | ||
input: | ||
restore_model_path: null | ||
output: | ||
save_model_path: null | ||
save_embed_path: null | ||
hyperparam: | ||
dropout: 0. | ||
lr: 0.001 | ||
no_validation: false | ||
rgcn: | ||
num_bases: -1 | ||
use_self_loop: true | ||
use_node_embeddings: false | ||
multi_task_learning: | ||
- node_classification: | ||
target_ntype: "movie" | ||
label_field: "label" | ||
multilabel: false | ||
num_classes: 19 | ||
batch_size: 16 # will overwrite the global batch_size | ||
mask_fields: | ||
- "train_mask_c0" # node classification mask 0 | ||
- "val_mask_c0" | ||
- "test_mask_c0" | ||
eval_metric: | ||
- "accuracy" | ||
- link_prediction: | ||
lp_loss_func: "contrastive" | ||
num_negative_edges: 4 | ||
num_negative_edges_eval: 100 | ||
train_negative_sampler: joint | ||
eval_etype: | ||
- "user,rating,movie" | ||
train_etype: | ||
- "user,rating,movie" | ||
exclude_training_targets: true | ||
reverse_edge_types_map: | ||
- user,rating,rating-rev,movie | ||
batch_size: 128 # will overwrite the global batch_size | ||
mask_fields: | ||
- "train_mask_field_lp" | ||
- null # empty means there is no validation mask | ||
- "test_mask_field_lp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.