KlugerLab / SpectralNet

Deep network that performs spectral clustering
MIT License
321 stars 103 forks source link

Question about squared_distance fucntion #18

Open zhangfanmark opened 5 years ago

zhangfanmark commented 5 years ago

Hi! First of all, thanks for providing this nice work!

While I am looking into the code, I found the _squareddistance function is a little bit confusing. If Y is not provided (so Y = X), this function will do an option of X - X and then take the sum. So, isn't the return value zero?

https://github.com/KlugerLab/SpectralNet/blob/43b0fca784491f234489b860fc35832697ad20c2/src/core/costs.py#L11-L33

Another question about the number of clusters K, can I use a relatively larger number when my dataset contains about 1 million samples? For example, over 1000?

Thanks! Fan

joshxin commented 5 years ago

I guess you neglected line 25 : )