IcarusWizard / MAE

PyTorch implementation of Masked Autoencoder
MIT License
234 stars 46 forks source link

Why do the masks' positions on the visualized images are same? #5

Closed WhiteLie98 closed 2 years ago

WhiteLie98 commented 2 years ago

I run the pretrain program and saw the visualized images on tensorboard. I found that the masks of those 16 images are exactly the same as yours. So I was wondering if it isn't actually random shuffled? The picture with time is the visualization of mine, and the other is yours. 问题1 问题2

IcarusWizard commented 2 years ago

Yes, these images are just the first 16 images on the cifar10 validation dataset. I didn't shuffle the dataset since I want to see how reconstruction gets better as we trained longer.

WhiteLie98 commented 2 years ago

Yes, these images are just the first 16 images on the cifar10 validation dataset. I didn't shuffle the dataset since I want to see how reconstruction gets better as we trained longer.

Sorry, maybe I didn't express the question clearly. My question is not about the selected 16 images from the dataset, but the reason why are those masks positions same? Theoretically, these masked patches should be shuffled randomly.

IcarusWizard commented 2 years ago

Oh, I see.

Yes, the patches are shuffled randomly, and you can verify that by checking the visualization for different epochs (just scroll the tensorboard).

However, you get the same result as mine is because we fix the random seed at the beginning, which controls all the randomness. That is, if you run the code without changing the default random seed, you get exactly the same result I got, even for the positions that were masked in the last visualization.

WhiteLie98 commented 2 years ago

Oh, I see.

Yes, the patches are shuffled randomly, and you can verify that by checking the visualization for different epochs (just scroll the tensorboard).

However, you get the same result as mine is because we fix the random seed at the beginning, which controls all the randomness. That is, if you run the code without changing the default random seed, you get exactly the same result I got, even for the positions that were masked in the last visualization.

I see. Thank you very much!