facebookresearch / mae

PyTorch implementation of MAE https//arxiv.org/abs/2111.06377
Other
6.93k stars 1.17k forks source link

Question about `len_keep` at random masking function #157

Open comojin1994 opened 1 year ago

comojin1994 commented 1 year ago

https://github.com/facebookresearch/mae/blob/efb2a8062c206524e35e47d04501ed4f544c0ae8/models_mae.py#L144

Hi!

I have a question about the above code. In my opinion, to make the mask, the above code will be revised in 'mask[:, len_keep:] = 0'. I think your code is interpreted as masking in the range of 0 ~ len_keep.

Is there any reason you wrote your code as mask[:, :len_keep] = 0?

alexlioralexli commented 6 months ago

This should be correct. 0 denotes keeping the patch, and 1 denotes masking out the patch.