[论文笔记] Domain-Adaptive Few-Shot Learning
github链接:[GitHub - dingmyu/DAPN: A pytorch implementation of "Domain-Adaptive Few-Shot Learning"](https://github.com/dingmyu/DAPN "GitHub - dingmyu/DAPN: A pytorch implementation of "Domain-Adaptive Few-Shot Learning"") (有bug和文件缺失,无法运行)

Methodology (论文原图,侵删)

Problem Definition
given - a large sample set
from a set of source classes
in a source domain
- a few-shot sample set
from a set of target classes
in the target domain
- a test set
from another set of target classes
in the target domain,
where 1)
,
,
- data distributions on
and
are also different
Objective: training a model with
and
and then evaluating its generalization
ability on 
Episode Training
To form a training episode
:
1. randomly choose
classes from 
2. build two sets of samples from the
classes: the support set
consists of
samples (k samples per class), and the query set
is composed of samples from the same
classes.
Also build training episodes from the few-shot sample set Dd (data augmentation method needed).
To form a training episode
:
1. randomly choose
classes from 
2. build two sets of samples from the
classes: the support set
consists of
samples (k samples per class), and the query set
is composed of samples from the same
classes.
Feature Extractor
原文代码的 Feature Extractor 使用的是ResNet18
Prototypical Learning
基本思路是基于Prototypical network: Learn a prototype of each class in the support set
, and classifies each sample in the query set
based on the distances between each sample and different prototypes.
sample embedding
和 class prototype
的距离可以用以下公式计算(dist 是欧氏距离)

loss function over each episode
就是基于每一个query sample的negative log-probability:

同理,loss function over each episode
就是基于每一个query sample的negative log-probability:

Domain Adversarial Adaptation Module
1. Domain Adaptive Embedding
The embedding module consists of an autoencoder and an attention submodule.
目的: 为了使得到的feature尽可能domain-confused
2. Domain Adaptive Loss
根据文章Conditional Domain Adversarial Network (CDAN) 额外加入一个domain
discriminator
来处理 source distribution
和 target distribution
之间的 domain adversarial loss:

Domain Discriminative Loss
The features before and after the embedding layer with self-attention are distinguished and confused, respectively:

Adaptive Reweighting Module
用自适应模块将四个loss进行累加
Experiments
[略]在miniImageNet,tieredImageNet和DomainNet 上进行训练
