Ejemplo n.º 1
0
 def __init__(self):
     super(CifarNet, self).__init__()
     self.pool = nn.MaxPool2d(kernel_size=2, stride=2, padding=0)
     self.dropout_050 = nn.Dropout(0.50)
     self.conv_block1 = omth_blocks.Conv_Block(input=3,
                                               filters=[32, 32],
                                               kernel_sizes=[3, 3],
                                               stride=[1, 1],
                                               padding=[1, 0],
                                               batch_norm=None,
                                               dropout=[0, 0.25])
     self.conv_block2 = omth_blocks.Conv_Block(input=32,
                                               filters=[64, 64],
                                               kernel_sizes=[3, 3],
                                               stride=[1, 1],
                                               padding=[1, 0],
                                               batch_norm=None,
                                               dropout=[0, 0.25])
     self.fc_layer = omth_blocks.fc_layer(2304, [512, 10],
                                          activation=[nn.ReLU(), None],
                                          batch_norm=False)
Ejemplo n.º 2
0
 def __init__(self, input, group):
     super().__init__()
     self.group = group
     self.channel = input
     self.attn_estimation = omth_blocks.Conv_Block(
         input * group,
         filters=[group * input, group],
         kernel_sizes=[3, 1],
         stride=[1, 1],
         padding=[1, 0],
         groups=[group, group],
     )
Ejemplo n.º 3
0
 def create_global_conv(self):
     global_conv = []
     for i, channel in enumerate(self.channels):
         if i == 0:
             input_channel = self.group * self.args.img_channel
         else:
             input_channel = self.channels[i - 1]
         global_conv.append(
             omth_blocks.Conv_Block(input_channel,
                                    filters=channel,
                                    kernel_sizes=self.kernel_sizes[i],
                                    padding=self.global_padding[i],
                                    stride=self.strides[i],
                                    batch_norm=self.batch_norm))
     self.global_conv = nn.Sequential(*global_conv)
Ejemplo n.º 4
0
 def __init__(self, input, group, comb_method="add"):
     super().__init__()
     self.group = group
     self.channel = input
     self.comb_method = comb_method.lower()
     assert self.comb_method in ["add", "conv"]
     if self.comb_method == "conv":
         self.comb_conv = omth_blocks.Conv_Block(
             input * group * 2,
             filters=[input * group * 2, input * group],
             kernel_sizes=[3, 1],
             stride=[1, 1],
             padding=[1, 0],
             groups=[group, group],
         )