mboudiaf/RePRI-for-Few-Shot-Segmentation

Few-Shot RePRI Setup

MSiam opened this issue · 2 comments

MSiam commented

Hello thanks for making the code available.

I have a question regarding the few-shot setup itself. I can see that you perform the RePRI inference in test.py after you accumulate multiple tasks (200 in case of 1-shot). The problem is that you finetune the classifier weights with these 200 tasks at once inside RePRI code in src/classifier.py

But wouldn't this mean that you are finetuning with 200 support sets. How is this still considered fewshot?
I thought the fewshot setup would require to test each task standalone

Or do you handle this with ensuring that self.prototype in classifier code is already n_task x c so you learn a separate weight for every task? Just confirming. Thanks

Hi @MSiam,

Great question ! Indeed as you guessed it, tasks are still treated independently because we learn n_tasks independent weights, one for each task. The total loss uses is the sum of each task-wise loss : L = L1 + ... + L_{n_task}, and each weight w_i only contributes to loss L_i, which means we still have dL / dw_i = dL_i / d_wi.
One simple sanity check is to modify the value of the parameter bsz_val which controls the amount of samples accumulated, and to observe consistent results.

Hope this answers the question !

MSiam commented

Thanks for your reply greatly appreciate it.