few-shot是哪篇论文提出
时间: 2025-06-07 08:48:38 浏览: 34
Few-shot learning 的概念最早可以追溯到 Lake 等人在 2011 年的一篇论文,该论文首次提出了从少量样本中学习的思路[^5]。然而,真正将 few-shot learning 系统化并引入深度学习领域的关键工作是由 Santoro 等人在 2016 年发表的《Meta-Learning with Memory-Augmented Neural Networks》[^6],以及由 Vinyals 等人在同年提出的《Matching Networks for One Shot Learning》[^7]。这些研究奠定了 few-shot learning 在现代深度学习中的理论基础。
此外,另一个重要的里程碑是 Snell 等人在 2017 年提出的 Prototypical Networks[^8],它为 few-shot learning 提供了一种基于度量学习的有效框架。尽管 few-shot learning 的具体术语可能在更晚的时间被正式定义,但上述研究标志着该领域的重要起点。
### Few-shot Learning 的核心思想
Few-shot learning 的目标是从有限数量的样本中学习新任务或类别,通常用于解决数据稀缺的问题。这一领域结合了元学习(meta-learning)、迁移学习(transfer learning)和生成模型等技术[^1]。
### 相关代码示例
以下是一个简单的 few-shot learning 框架的伪代码实现,基于 Prototypical Networks 的思想:
```python
import torch
import torch.nn as nn
class PrototypicalNetwork(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim):
super(PrototypicalNetwork, self).__init__()
self.encoder = nn.Sequential(
nn.Linear(input_dim, hidden_dim),
nn.ReLU(),
nn.Linear(hidden_dim, output_dim)
)
def forward(self, support_set, query_set):
# 编码支持集和查询集
prototypes = self.encoder(support_set).mean(dim=0) # 计算原型
query_embeddings = self.encoder(query_set)
# 计算距离
distances = torch.cdist(query_embeddings.unsqueeze(0), prototypes.unsqueeze(0))
return -distances.squeeze()
```
阅读全文
相关推荐

















