muzairkhattak / multimodal-prompt-learning

[CVPR 2023] Official repository of paper titled "MaPLe: Multi-modal Prompt Learning".
https://muzairkhattak.github.io/multimodal-prompt-learning/
MIT License
578 stars 42 forks source link

fine-tuning on cross-dataset #67

Closed aymane399 closed 4 weeks ago

aymane399 commented 2 months ago

Hello, Thank you for this very interesting contribution.

I am trying to use maple on custom datasets, and I understand that the cross-dataset scenraio uses the contexts learned from Imagenet pre-training and infers on the test splits of the novel dataset without finetuning on potential shots of the novel dataset.

Is my understanding correct? and if so how do I finetune on the novel dataset?

Thank you

muzairkhattak commented 1 month ago

Hi @aymane399,

Sorry for the delayed response.

Regarding your first question, yes your understanding it correct. For cross-dataset setting, we train only a single model using source dataset and then evaluate/test it directly on downstream novel datasets.

Regarding your second question, you can finetune on the novel dataset by simply replacing the dataset name in the run script.

For example:

For imagenet training, we use the following commands for all 3 seeds: bash scripts/maple/xd_train_maple.sh imagenet 1 bash scripts/maple/xd_train_maple.sh imagenet 2 bash scripts/maple/xd_train_maple.sh imagenet 3

Now, if you want to instead train the model on novel/cross-dataset, we can simply change the name of dataset. For example, training MaPLe on EuroSAT can be executed as follows:

bash scripts/maple/xd_train_maple.sh eurosat 1 bash scripts/maple/xd_train_maple.sh eurosat 2 bash scripts/maple/xd_train_maple.sh eurosat 3

I hope that is clear now. Kindly let me know if there is any other question.

Thank you and kind regards!