danfenghong / IEEE_TGRS_SpectralFormer

Danfeng Hong, Zhu Han, Jing Yao, Lianru Gao, Bing Zhang, Antonio Plaza, Jocelyn Chanussot. Spectralformer: Rethinking hyperspectral image classification with transformers, IEEE Transactions on Geoscience and Remote Sensing (TGRS), 2021
219 stars 39 forks source link

how to apply the test_epoch and output the classification map? #1

Open AlanMorningLight opened 2 years ago

AlanMorningLight commented 2 years ago

Dear danfeng, Thanks a lot for your sharing codes. I have a few questions:① Why is the sample set divided into only two parts: training set and test set? Why is there no validation set? ② How to use the test_epoch function? ③ How to output the entire classification map? Can you provide the code? Thank you very much for your reply.

danfenghong commented 2 years ago

Hi, Thank you very much for your interest in our work! Regarding these issues,

  1. You can seperate the validation set for sure, if you would like to tune the parameters using the validation set.
  2. I did not get your point? is there a difficulty to use this function?
  3. for the whole classification map, you only input all samples into the trained network and then use the matlab for showing.

Thanks again! Cheers, Danfeng

Wenchao QI @.***> 于2021年11月24日周三 上午11:22写道:

Dear danfeng, Thanks a lot for your sharing codes. I have a few questions:① Why is the sample set divided into only two parts: training set and test set? Why is there no validation set? ② How to use the test_epoch function? ③ How to output the entire classification map? Can you provide the code? Thank you very much for your reply.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/danfenghong/IEEE_TGRS_SpectralFormer/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFL2GZSBVARLCBZPO3R2ZDTUNRK7PANCNFSM5IVAONEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

AlanMorningLight commented 2 years ago

Hi, With your help, I have successfully run the program. But I have another question:

Thank you for your reply! best regards, Wenchao

danfenghong commented 2 years ago

Hi,

I think this is basic grammar for python to how to define such a vector. You can simply check some examples to how to define this label information. Cheers, Danfeng

Wenchao QI @.***> 于2021年11月27日周六 下午11:09写道:

Hi, With your help, I have successfully run the program. But I have another question:

  • Both training samples and test samples should contain 16 categories of Indian Pines dataset, but when using ''train_and_test_label'' function to generate the label corresponding to the training and test samples, why is the label value ''0-15'' instead of ''1-16''?
  • I think, '' y_train.append(i)'' and '' y_test.append(i)'' should be '' y_train.append(i+1)'' and '' y_test.append(i+1)'', respectively.
  • And y_true contains the background value 0, a total of 17 categories, and the label value is 0-16, so y_true. append (i) is correct in the demo.py.

Thank you for your reply! best regards, Wenchao

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danfenghong/IEEE_TGRS_SpectralFormer/issues/1#issuecomment-980641087, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFL2GZV3GS3S62VIGIUROJDUODYCHANCNFSM5IVAONEQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.