benedekrozemberczki / karateclub

Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)
https://karateclub.readthedocs.io
GNU General Public License v3.0
2.17k stars 247 forks source link

Estimator _check_graph method #129

Closed joaoaleite closed 1 year ago

joaoaleite commented 1 year ago

I was running Node2Vec and I noticed there is a "_check_graph" method on the base Estimator class that calls an "_ensure_integrity" method, which creates self-loops for every node, modifying the original input graph. Shouldn't this be done on a copy of the graph instead? Or maybe remove those at the end of training if you wouldn't want to store both in memory. Is there a reason you would want to keep the self-loops after computing the embeddings?