Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def makeSomeLayers(in_channels,out_channels,resolutions):
- layers = []
- for r in resolutions:
- layers.append(nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=r))
- return layers
- class Net(nn.Module):
- def __init__(self):
- super(Net, self).__init__()
- # example of adding
- in_channels = 3
- out_channels = 64
- resolutions = [3,5,7,9,11]
- self.convs = nn.ModuleList(makeSomeLayers(in_channels,out_channels,resolutions))
- def forward(self,x):
- # call the various defined operations on the input...
- outs = [op(x) for op in self.convs]
- # do something with output...
- x = .....
- return x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement