zoa*_*ndr 6 machine-learning neural-network deep-learning
深度学习中的多头模型是什么?
我迄今发现的唯一的解释是这样的:每一个模型都可以被认为是一个支柱加上一个头,如果你预先训练骨干,并把随机的头,你可以微调它,这是一个好主意,
可有人请提供更详细的说明。
\n\nHead 是网络的顶部。例如,在底部(数据进入的地方),您采用某些模型的卷积层,例如 resnet。如果您调用 ConvLearner.pretrained,CovnetBuilder 将为 Fast.ai 中的数据构建一个具有适当头部的网络(如果您正在研究分类问题,它将创建一个具有交叉熵损失的头部,如果您正在研究回归问题)问题,它将创建一个适合该问题的头)。
\n但您可以构建一个具有多个头的模型。该模型可以从基础网络(resnet 转换层)获取输入,并将激活馈送到某个模型,例如 head1,然后将相同的数据馈送到 head2。或者,您可以在 resnet 之上构建一些共享层,并且仅将这些层提供给 head1 和 head2。
\n您甚至可以将不同的层馈送到不同的头!这有一些细微差别(例如,对于 fastai lib,如果您不指定 custom_head 参数,ConvnetBuilder 将在基本网络顶部添加一个 AdaptivePooling 层,并且如果您这样做,则不会 \xe2 \x80\x99t) 但这是一般情况。
\n
The explanation you found is accurate. Depending on what you want to predict on your data you require an adequate backbone network and a certain amount of prediction heads.
For a basic classification network for example you can view ResNet, AlexNet, VGGNet, Inception,... as the backbone and the fully connected layer (with cross-entropy loss) as the sole prediction head.
A good example for a problem where you need multiple-heads is localization, where you not only want to classify what is in the image but also want to localize the object (find the coordinates of the bounding box around it).
The image below shows the general architecture

骨干网(“卷积和池化”)负责从包含更高级别摘要信息的图像中提取特征图。每个头部都使用此特征图作为输入来预测其期望的结果。
您为之优化的损失通常是每个预测头的单个损失的加权总和。