-- Network Definition
net = nn.Sequential()
net_ = nn.Parallel(1,2)
for i = 1,3 do
model1 = nn.Sequential()
model1:add(nn.SpatialConvolution(ch_in,ch_1,ker_1,ker_1,str_1,str_1,pad_1,pad_1));
model1:add(nn.SpatialBatchNormalization(ch_1))
model1:add(nn.ReLU())
model1:add(nn.SpatialConvolution(ch_1,ch_out,ker_2,ker_2,str_2,str_2,pad_2,pad_2));
net_:add(model1)
end
net:add(net_)
lightModel = net:clone('weight','bias','running_mean','running_std')
-- here goes the code for training the network---
--after completing the training
torch.save(<Path of the network>,lightModel)
---code for testing the network---
net = torch.load(<Path of the network>)
net:training()
temp = torch.rand(3,1,5,3,3)
temp = temp:cuda()
output = net:forward(temp)
print(output)