icoz69 / DeepEMD

Code for paper "DeepEMD: Few-Shot Image Classification with Differentiable Earth Mover's Distance and Structured Classifiers", CVPR2020
MIT License
575 stars 82 forks source link

opencv solver for 5-shot evaluation #32

Open Tsingularity opened 3 years ago

Tsingularity commented 3 years ago

Hi,

I saw the default setting (both the eval.py and the evaluation command-line script in the ReadMe file) is using opencv solver. However, for 5-shot evaluation, the structured FC weights need gradients to update. But looks like the opencv solver layer is not differentiable? So how could the SFC weights be updated given this situation?

Thanks!

karayzhou commented 3 years ago

I'm also confused about the opencv solver layer, is this layer differentiable.

icoz69 commented 3 years ago

hi in the 5-shot case, the gradient can flow back to the prototypes through the cost matrix.

karayzhou commented 3 years ago

thanks for your reply, I'm very interested in your execllent work. could provide more training details about 5-shot case, such as lr, max_epoch,val_episode,sfc_lr,and so on. in addition, in 5-shot case ,is it necessary to pretrain the model in 5-case scene, that is in validation phase, select the best model in 5-shot Deepemd setting.

icoz69 commented 3 years ago

hi, 5-shot testing does not need training. you can simply use the trained one-shot model to undertake 5-shot testing and use the default parameters. carefully tuning the sfc_lr can obtain better results.