locuslab / FLYP

Code for Finetune like you pretrain: Improved finetuning of zero-shot vision models
MIT License
87 stars 14 forks source link

Results of ZS, FT, LP, LP-FT #11

Closed Bala93 closed 1 year ago

Bala93 commented 1 year ago

May I know how did you get the results of other baselines ? If possible could you also share that?

SachinG007 commented 1 year ago

ZS is the standard inference based on the openCLIP code https://github.com/mlfoundations/open_clip. We do FT using standard CE loss, just use ZS weights for initializing the linear layer rather than random init.

LP is done using LBFGS solver from sklearn (https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html). I am adding the core code (https://github.com/locuslab/FLYP/blob/main/src/models/linear_lbfgs.py) for that which might be useful to you (along with the necessary helper file https://github.com/locuslab/FLYP/blob/main/src/models/common.py). You will have to integrate and clean it with your codebase a bit for argument and data passing.

LP-FT follows from above.

Thanks

Bala93 commented 1 year ago

Thank you so much for your detailed reply. Will incorporate them in my code base.