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

Issues with dglke_emb_sim #253

Open
Maristela-de-Jesus opened this issue Mar 8, 2022 · 3 comments
Open

Issues with dglke_emb_sim #253

Maristela-de-Jesus opened this issue Mar 8, 2022 · 3 comments

Comments

@Maristela-de-Jesus
Copy link

Maristela-de-Jesus commented Mar 8, 2022

Hi,

I would like to find the similarity scores of TransE, and I am finding the same error as this one https://github.com/awslabs/dgl-ke/issues/160

!DGLBACKEND=pytorch dglke_emb_sim --model_path ./wikimedia/TransE_l2_wikimedia_0/ \
--format 'h_*_*' --data_files head.list \
--score_func none --topK 10 --gpu 0

The results:

usage: dglke_emb_sim [-h] [--mfile MFILE] [--emb_file EMB_FILE]
                     [--format FORMAT]
                     [--data_files DATA_FILES [DATA_FILES ...]] [--raw_data]
                     [--exec_mode EXEC_MODE] [--topK TOPK]
                     [--sim_func SIM_FUNC] [--output OUTPUT] [--gpu GPU]
dglke_emb_sim: error: unrecognized arguments: --model_path ./wikimedia/TransE_l2_wikimedia_0/ --score_func none

I saw the suggestion to use dglke_predict instead, but I would need to use dglke_emb_sim to check the node similarities.

Any idea how I can solve this?

Thank you!

@classicsong
Copy link
Contributor

dglke_emb_sim accepts embedding files, i.e., --emb_file instead of --model_path

@Maristela-de-Jesus
Copy link
Author

Maristela-de-Jesus commented Mar 9, 2022

Thank you for your answer, @classicsong :)

I changed to --emb_file. However, the score_func seems to be not an acceptable args.

I also tried --score_func logsigmoid, but it still didn't work.

Updated code:

!DGLBACKEND=pytorch dglke_emb_sim --emb_file ./wikimedia/TransE_l2_wikimedia_0/wikimedia_TransE_l2_entity.npy \
--format 'h_*_*' --data_files head.list \
--score_func none --topK 10

Result:

usage: dglke_emb_sim [-h] [--mfile MFILE] [--emb_file EMB_FILE]
                     [--format FORMAT]
                     [--data_files DATA_FILES [DATA_FILES ...]] [--raw_data]
                     [--exec_mode EXEC_MODE] [--topK TOPK]
                     [--sim_func SIM_FUNC] [--output OUTPUT] [--gpu GPU]
dglke_emb_sim: error: unrecognized arguments: --score_func none

Thank you :)

@classicsong
Copy link
Contributor

You do not need to specify score_func as this is for entity embedding similarity.

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