【发布时间】:2016-12-15 10:59:26
【问题描述】:
我有一个数据集,每张图片都有大约 101 个标签。我知道,我必须使用 HDF5 数据层将我的数据输入网络。但问题是我有一个多任务设置。我的网络共享前 5 层的参数,然后分支。在 101 个标签中,我想将 100 个标签发送给一个任务,将 1 个标签发送给第二个任务。
现在,我该怎么做?我可以以某种方式执行以下操作:
layer {
name: "data"
type: "HDF5Data"
top: "data"
top: "label1" ############# A scalar label
top : "label2" ######## A vector of size 100
include {
phase: TRAIN
}
hdf5_data_param {
source: "path/to/the/text/file/test.txt"
batch_size: 10
}
}
上述设置中有两个顶级 blob。一个用于 100 维向量 (label2),另一个用于剩余标签 (label1)。
这种设置可行吗?
我还在某处读到,可以拆分多维向量,指定 prototxt 文件本身中的拆分规范。在这种情况下,我将不得不为标签(101 维)使用单个顶部 blob,然后以某种方式拆分
100-d 和 1-d(标量)两个向量中的 101-d 向量。如何做到这一点?
这种情况下的图层会:
layer {
name: "data"
type: "HDF5Data"
top: "data"
top : "label" ######## A vector of size 101
include {
phase: TRAIN
}
hdf5_data_param {
source: "path/to/the/text/file/test.txt"
batch_size: 10
}
}
## Some layer to split the label blob into two vectors of 100-d and 1-d respectively
对这种拆分如何运作有任何想法吗?
【问题讨论】:
-
是的,有可能。看看这个:stackoverflow.com/questions/33140000/…
标签: neural-network deep-learning hdf5 caffe multilabel-classification