Sha-Lab / FEAT

The code repository for "Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions"
MIT License
418 stars 84 forks source link

关于feat.py模型内部关于输入数据shape的问题 #51

Closed shuowang666 closed 3 years ago

shuowang666 commented 3 years ago

请问一下data sample的过程代码是按episode来取的,每次也是一个episode输入model,为什么模型内部的解决的输入shape为(batch, (n_way)(shot+query), embed),而不是((n_way)(shot+query), embed)呢?

Han-Jia commented 3 years ago

((n_way)(shot+query), embed)这样设定是可以的,可以适配当前的算法。

写成(batch, (n_way)(shot+query), embed)是为了考虑在一次episode中同时处理多个task,获得更好的梯度估计。一般在有pretrain权重时一次处理多个task提升不明显。

shuowang666 commented 3 years ago

好的,非常感谢解答