KlugerLab / SpectralNet

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

Unsupervised #5

Closed NohYoon closed 6 years ago

NohYoon commented 6 years ago

Hello. First of all, I appreciate your wonderful work.

I have one question. How can I implement spectralnet as unsupervised version?

I think application part is only for the supervised learning with label.

lihenryhfl commented 6 years ago

Hi, thanks for responding. Spectralnet is actually fully unsupervised, and the labels are only used to evaluate the model. Ideally, you'd want to have some labels to tune the way you build the affinity kernel, but this is a fundamental aspect to all spectral clustering algorithms, and using the default parameters (for MNIST or Reuters) would be a good start.

To remove the dependence on the labels, you can redefine run_net() in src/applications/spectralnet.py so that it does not include the final EVALUATE section, and so that it does not take the labels, y_train or y_test, as arguments. Since the model was designed to also perform semi-supervised training, you will still need to provide a labels placeholder and feed an empty vector during training/evaluation (refer to variables 'y_true' and 'y_train_labeled_onehot', respectively, in src/applications/spectralnet.py as an example).

lihenryhfl commented 6 years ago

I will close this issue, but if you have further questions feel free to open another or contact me!