def __init__(self): super(NNNormalizationModule, self).__init__() self.input1d = torch.randn(1, 4, 50) self.module1d = nn.ModuleList([ nn.BatchNorm1d(4), nn.InstanceNorm1d(4), ]) self.input2d = torch.randn(1, 4, 30, 10) self.module2d = nn.ModuleList([ nn.BatchNorm2d(4), nn.GroupNorm(4, 4), nn.InstanceNorm2d(4), nn.LayerNorm([4, 30, 10]), nn.LocalResponseNorm(2), ]) self.input3d = torch.randn(1, 4, 10, 4, 4) self.module3d = nn.ModuleList([ nn.BatchNorm3d(4), nn.InstanceNorm3d(4), nn.ChannelShuffle(2), ])
def __init__(self): super(NNShuffleModule, self).__init__() self.shuffle = nn.ChannelShuffle(2)
def __init__(self): super(Model, self).__init__() self.shuffle_0 = nn.ChannelShuffle(2) self.shuffle_1 = nn.ChannelShuffle(16)