Marigoldwu / A-Unified-Framework-for-Deep-Attribute-Graph-Clustering

This project is a scalable unified framework for deep graph clustering.
https://www.marigold.website/readArticle?workId=145&author=Marigold&authorId=1000001
MIT License
85 stars 11 forks source link

[Enhancement] max_embedding should be initialized along with max_acc etc. #7

Open habaneraa opened 9 months ago

habaneraa commented 9 months ago

In the training modules, the max_embedding variables are not initialized with any matrix. In rare cases, the evaluated metric scores never increase and the branch in if acc > acc_max: is never excuted. An exception would be raised when it reaches line max_embedding = max_embedding[sort_indices] because the variable was never assigned.

As users, we prefer the program to run without exception and return results even though the metric scores are low and the embeddings are bad.

A possible solution is to initialize acc_max to -1. Therefore, whatever the actual accuracy is, the branch in if acc > acc_max: will always be executed and extra initializations will not be needed.