- Paper link: metapath2vec: Scalable Representation Learning for Heterogeneous Networks
- Author's code repo: https://ericdongyx.github.io/metapath2vec/m2v.html.
- PyTorch 1.0.1+
How to run the code
Run with the following procedures:
1, Run sampler.py on your graph dataset. Note that: the input text file should be list of mappings so you probably need to preprocess your graph dataset. Files with sample format are available in "net_dbis" file. Of course you could also use your own metapath sampler implementation.
2, Run the following command:
python metapath2vec.py --download "where/you/want/to/download" --output_file "your_output_file_path"
Tips: Change num_workers based on your GPU instances; Running 3 or 4 epochs is actually enough.
Tricks included in the implementation:
2, Negative Sampling without repeatedly calling numpy random choices;
Performance and Explanations:
Venue Classification Results for Metapath2vec:
Author Classfication Results for Metapath2vec:
Testing files are available in "label 2" file;
The above are results listed in the paper, in real experiments, exact numbers might be slightly different:
1, For venue node classification results, when the size of the training dataset is small (e.g. 5%), the variance of the performance is large since the number of available labeled venues is small.
2, For author node classification results, the performance is stable since the number of available labeled authors is huge, so even 5% training data would be sufficient.
3, In the test.py, you could change experiment times you want, especially it is very slow to test author classification so you could only do 1 or 2 times.