Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run your code with link prediction task? #33

Closed
GabbySuwichaya opened this issue Mar 9, 2021 · 2 comments
Closed

How to run your code with link prediction task? #33

GabbySuwichaya opened this issue Mar 9, 2021 · 2 comments

Comments

@GabbySuwichaya
Copy link

GabbySuwichaya commented Mar 9, 2021

Hello, again... I would like to ask about how to configure your script for running with link prediction tasks...
It is just that at the moment, I am a little confused, and I hope you could help explain...?

  • From my understanding, if I want to run your demo with link prediction, I should just set the custom key --custom-key EV13NSO8-ES-Link as in the following command line ...is that right?
python3 SuperGAT/main.py   --dataset-class Planetoid    --dataset-name Cora   --custom-key EV13NSO8-ES-Link     --num-gpus-total 2  
  • However, I get the following error:
Traceback (most recent call last):
  File "SuperGAT/main.py", line 475, in <module>
    many_seeds_result = run_with_many_seeds(main_args, num_total_runs, gpu_id=alloc_gpu[0])
  File "SuperGAT/main.py", line 407, in run_with_many_seeds
    ret = run(_args, gpu_id=gpu_id, **kwargs)
  File "SuperGAT/main.py", line 321, in run
    run_link_prediction=(perf_task_for_val == "Link"))
  File "SuperGAT/main.py", line 202, in test_model
    val_or_test_edge_y = batch.val_edge_y if val_or_test == "val" else batch.test_edge_y
AttributeError: 'Data' object has no attribute 'val_edge_y'

Also, I have noticed that the option is_link_gnn=False .... What does this mean?

Here is the print out of the options:

        - att_lambda: 11.346574532931719
        - attention_type: prob_mask_only
        - batch_size: 128
        - checkpoint_dir: ../SuperGAT_checkpoints
        - custom_key: EV13NSO8-ES-Link
        - data_num_splits: 1
        - data_root: ~/graph-data
        - data_sampler: None
        - data_sampling_num_hops: None
        - data_sampling_size: None
        - dataset_class: Planetoid
        - dataset_name: Cora
        - dropout: 0.6
        - early_stop_patience: 485
        - early_stop_queue_length: 484
        - early_stop_threshold_loss: 0.009317052513589488
        - early_stop_threshold_perf: 0.0011587124922279313
        - edge_sampling_ratio: 0.8
        - epochs: 490
        - gpu_deny_list: [1, 2, 3]
        - heads: 8
        - is_cgat_full: False
        - is_cgat_ssnc: False
        - is_link_gnn: False
        - is_super_gat: True
        - l1_lambda: 0.0
        - l2_lambda: 0.008228864972965771
        - link_lambda: 0.0
        - loss: None
        - lr: 0.005
        - m: 
        - model_name: GAT
        - neg_sample_ratio: 0.5
        - num_gpus_to_use: 1
        - num_gpus_total: 2
        - num_hidden_features: 8
        - num_layers: 2
        - out_heads: 8
        - perf_task_for_val: Link
        - perf_type: accuracy
        - pool_name: None
        - pretraining_noise_ratio: 0.0
        - save_model: False
        - save_plot: True
        - scaling_factor: None
        - seed: 42
        - start_epoch: 0
        - super_gat_criterion: None
        - task_type: Link_Prediction
        - to_undirected: False
        - to_undirected_at_neg: False
        - total_pretraining_epoch: 0
        - use_bn: False
        - use_early_stop: True
        - use_pretraining: False
        - val_interval: 1
        - verbose: 0
        
@dongkwan-kim
Copy link
Owner

if I want to run your demo with link prediction, I should just set the custom key --custom-key EV13NSO8-ES-Link as in the following command line ...is that right?

Change Planetoid to LinkPlanetoid will solve the issue.
This class is basically the same as the original one, but with train/val/test split of edges.

Also, I have noticed that the option is_link_gnn=False .... What does this mean?

You can think is_link_gnn flag is deprecated.
This is for the model I experimented with before but did not put into the paper.

@GabbySuwichaya
Copy link
Author

Thank you so much. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants