0
local net = nn.Sequential()
net:add(SpatialConvolution(3, 64, 4, 4, 2, 2, 1, 1))
以下开始与输入张量input
local input = torch.Tensor(batchSize, 3, 64, 64)
// during training
local output = net:forward(input)
我要修改网络接受第二张cond
作为输入
local cond = torch.Tensor(batchSize, 1000, 1, 1)
// during training
local output = net:forward({input, cond})
我在添加SpatialConvolution之前通过添加JoinTable来修改网络,如下所示:
local net = nn.Sequential()
net:add(nn.JoinTable(2, 4))
net:add(SpatialConvolution(3, 64, 4, 4, 2, 2, 1, 1))
这是不工作,因为这两个张量具有在尺寸2,3不同的尺寸,和4给予cond
张量为(BATCHSIZE,1000,64,64)的大小是不因为其浪费的选项的记忆。
是否有任何合并网络开始时两个不同张量馈入第一层的最佳做法。
使用nngraph做的伎俩 – Scholle