Skip layer in pyTorch
Thank you all for the help in this fabulous forum. I was a Torch user, and new to pytorch. Right now I want to do something like “skip connection”. Below is the code I used in torch. How can I make a “skip connection” in pytorch <SCODE>main = nn.Sequential()
...
local conc = nn.ConcatTable()
local conv = nn.Sequential()
conv:add(SpatialConvolution(...))
conc:add(nn.Identity())
conc:add(conv)
main:add(conc)
main:add(nn.CAddTable())<ECODE>
wzhang35
Assuming proper padding for compatible sizes - <SCODE>input = Variable(torch.Tensor(...))
conv_out =self.conv(input)
out = conv_out + input

<ECODE>
DiffEverything
mattmacy