local splitFeatureModule = nn.ConcatTable()
splitFeatureModule:add(nn.Narrow(1, 1, batchSize/5))
splitFeatureModule:add(nn.Narrow(1, batchSize/5 + 1, -1))
--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+unsubscribe@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at https://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.
torch.chunk does this
On Thu, Sep 29, 2016 at 10:46 PM, Tuấn Nguyễn Anh Hoàng via torch7 <torch7+APn2wQdUwFKOqDMio0QkML4VotH3jmhAzEj3NDWpHoJX0L_5-p7YOeo7k@googlegroups.com> wrote:
Hi all,I want to create a model which includes a module that can split a mini-batch input into 2 unequal parts, specifically 1/5 and 4/5.Currently, I use nn.Narrow. However, this requires the batch size known at the model-create time. Which reduces the flexibility in the training phase.
local splitFeatureModule = nn.ConcatTable()
splitFeatureModule:add(nn.Narrow(1, 1, batchSize/5))
splitFeatureModule:add(nn.Narrow(1, batchSize/5 + 1, -1))Is there any way to create a module which has the same function but independence to the batch size?Any idea is always appreciated. Thank you very much.Have a great day all.Best regards
--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.