awslabs / dgl-ke

High performance, easy-to-use, and scalable package for learning large-scale knowledge graph embeddings.
https://dglke.dgl.ai/doc/
Apache License 2.0
1.25k stars 194 forks source link

Make dgl-ke deterministic #252

Closed fburdet closed 2 years ago

fburdet commented 2 years ago

Dear all,

I'm trying to make dglk-ke deterministic (ie launch 2x the same dglke_train command, calculate the scores for the same edges and get exactly the same score). That would sound like more than a nice to have...

I tried some of the tips in https://github.com/awslabs/dgl-ke/issues/76 that is,

but it doesn't work. Any easier way to make the command deterministic?

Thanks in advance for your help!

classicsong commented 2 years ago

The training is also random (edge sampling)

fburdet commented 2 years ago

Thanks for the answer, @classicsong !

Any way to also set the seed for the edge sampling?

classicsong commented 2 years ago

You can try set both numpy and torch seeds.