Lightning-Universe / lightning-bolts

Toolbox of models, callbacks, and datasets for AI/ML researchers.
https://lightning-bolts.readthedocs.io
Apache License 2.0
1.66k stars 321 forks source link

Adding swin to the self-supervised swav #974

Open AhmedHamdi101 opened 1 year ago

AhmedHamdi101 commented 1 year ago

🚀 Feature

Addition of Swin, SwinV2 to the swav self-supervised models

Motivation and Pitch

Swin, SwinV2 vision transformers are currently one of the top-performing models on multiple computer vision tasks, but such as all transformers, training them would need a large number of samples. I thought that a self-supervised approach such as SWAV would benefit those models and help use those vision transformers in low resources tasks.

I am very eager to add it myself.

Atharva-Phatak commented 1 year ago

SWAV is already implemented in lightning bolts. You will have to inherent SWAV class and override init_model method for training SWIN transformers. FYI I recommend you check DINO for training vision transformers. SWaV is not the best candidate.

AhmedHamdi101 commented 1 year ago

SWAV is already implemented in lightning bolts. You will have to inherent SWAV class and override init_model method for training SWIN transformers. FYI I recommend you check DINO for training vision transformers. SWaV is not the best candidate.

But when I override the init_model I will also need to modify SWIN architecture by

So I added the modified SWIN in swin_swav.py and instead of overriding the init_model, I just added them as arch options to be chosen for ease of use.