Dotori-HJ / SelfOrganizingMap-SOM

Pytorch implementation of Self-Organizing Map(SOM). Use MNIST dataset as a demo.
MIT License
44 stars 11 forks source link

question about the result #1

Open yuzehui1996 opened 5 years ago

yuzehui1996 commented 5 years ago

I am confused about the loss did not decrease at all and the som_result.png was not the same as you showed.Should I change the hyperparameter such as lr or total epochs? Thanks a lot!

Dotori-HJ commented 5 years ago

Did you wait for the learning to end? During SOM learning, In my code change the hyperparameters to match the epoch. So you can see the desired results at the end of the learning.

If you want to see the results more quickly, reduce the number of trainning data. You can insert below code, under 66 lines of

train_data.train_data = train_data.train_data[:1000]
train_data.train_labels = train_data.train_labels[:1000]

That way, you'll only use 1,000 trainning data. I hope you get a good result:)

heitorrapela commented 5 years ago

I used all dataset training with a 30x30 grid :+1: I got a good result:

All Mnist Dataset trained with 30x30 SOM grid

Bibyutatsu commented 5 years ago

Hi, how can I get the mapping for my test set ? It contains some images of handwriting and I want to know which cluster or location it belongs to.

Dotori-HJ commented 5 years ago

You can choose the closest one by comparing the weights of trained som with the value of your test data.

probably, pairwise distance will help you.