Beispiel #1
0
 def __init__(_,net_name,out_channels):
     super().__init__()
     _.net_name = net_name
     _.shapes_have_been_printed = False
     _.a = nn.Conv2d(a, b, kernel_size=3, stride=2)
     _.b = nn.ReLU(inplace=True)
     _.c = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.d = Fire(b, b_, c, c)            
     _.e = Fire(c+c, b, d, d)
     _.f = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.g = Fire(e, c, e, e)
     _.i = Fire(e+e, c, e, e)
     _.j = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.k = nn.Upsample((32,32),mode='nearest')
     _.k2 = nn.Upsample((64,64),mode='nearest')
     _.k3 = nn.Upsample((200,200),mode='nearest')
     _.l = nn.Conv2d(
         in_channels=d+d,
         out_channels=out_channels,
         padding=1,
         kernel_size=3)
     _.l2 = nn.Conv2d(
         in_channels=e+e,
         out_channels=out_channels,
         padding=1,
         kernel_size=3)
     _.o = nn.AvgPool2d(2, stride=2)
     _.bn3 = nn.BatchNorm2d(a)
     _.bn32 = nn.BatchNorm2d(d)
     _.bn64 = nn.BatchNorm2d(e)
Beispiel #2
0
 def __init__(self,net_name):
     super().__init__()
     self.net_name = net_name
     self.shapes_have_been_printed = True
     self.a = nn.Conv2d(a, d, kernel_size=3, stride=2)
     self.b = nn.ReLU(inplace=True)
     self.c = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     self.d = Fire(d, b, d, d)            
     self.e = Fire(d+d, b, d, d)
     self.f = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     self.g = Fire(e, c, e, e)
     self.i = Fire(e+e, c, e, e)
     self.j = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     self.k = nn.Upsample((32,32),mode='nearest')
     self.k2 = nn.Upsample((64,64),mode='nearest')
     self.k3 = nn.Upsample((140,140),mode='nearest')
     self.l = nn.Conv2d(
         in_channels=d+d,
         out_channels=a,
         padding=1,
         kernel_size=3)
     self.l2 = nn.Conv2d(
         in_channels=e+e,
         out_channels=a,
         padding=1,
         kernel_size=3)
     self.o = nn.AvgPool2d(2, stride=2)
     self.bn3 = nn.BatchNorm2d(3)
     self.bn32 = nn.BatchNorm2d(32)
     self.bn64 = nn.BatchNorm2d(64)
Beispiel #3
0
 def __init__(_, net_name, out_channels):
     super().__init__()
     _.A = {}
     _.quant = torch.quantization.QuantStub()
     _.dequant = torch.quantization.DeQuantStub()
     _.net_name = net_name
     _.shapes_have_been_printed = False
     _.a = torch.nn.Conv2d(a, b_, kernel_size=3, stride=2)
     _.b = nn.ReLU(inplace=True)
     _.c = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.d = Fire(b_, b_, b_, b_)
     _.e = Fire(b, b, b_, b_)
     _.f = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.g = Fire(e, c, c, c)
     _.i = Fire(c + c, c, c, c)
     _.j = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.k = nn.Upsample((32, 32), mode='nearest')
     _.k2 = nn.Upsample((64, 64), mode='nearest')
     _.k200 = nn.Upsample((200, 200), mode='nearest')
     _.k1000 = nn.Upsample((1000, 1000), mode='nearest')
     _.l = nn.Conv2d(in_channels=d + d,
                     out_channels=out_channels,
                     padding=1,
                     kernel_size=3)
     _.l2 = nn.Conv2d(in_channels=b,
                      out_channels=out_channels,
                      padding=0,
                      kernel_size=1)
     _.o = nn.AvgPool2d(2, stride=2)
     _.bn3 = nn.Identity()  #nn.BatchNorm2d(a)
     _.bn32 = nn.Identity()  #nn.BatchNorm2d(d)
     _.bn64 = nn.Identity()  #nn.BatchNorm2d(e)
Beispiel #4
0
 def __init__(_, net_name, in_channels, out_channels):
     super().__init__()
     _.quant = torch.quantization.QuantStub()
     _.dequant = torch.quantization.DeQuantStub()
     _.net_name = net_name
     _.shapes_have_been_printed = False
     _.a = nn.Conv2d(in_channels, d, kernel_size=3, stride=2)
     _.b = nn.ReLU(inplace=True)
     _.c = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.d0 = Fire(35, 32, 32, 32)
     _.d0_ = Fire(38, 32, 32, 32)
     _.d1 = Fire(40, 32, 32, 32)
     _.d = Fire(d, b, d, d)
     _.e = Fire(d + d, b, b, b)
     _.f = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.g = Fire(e, c, e, e)
     _.i = Fire(e + e, c, e, e)
     _.j = nn.MaxPool2d(kernel_size=3, stride=2, ceil_mode=True)
     _.k = nn.Upsample((32, 32), mode='nearest')
     _.k2 = nn.Upsample((64, 64), mode='nearest')
     _.k200 = nn.Upsample((200, 200), mode='nearest')
     _.k1000 = nn.Upsample((1000, 1000), mode='nearest')
     _.l = nn.Conv2d(in_channels=d + d,
                     out_channels=out_channels,
                     padding=1,
                     kernel_size=3)
     _.l2 = nn.Conv2d(in_channels=e + e,
                      out_channels=out_channels,
                      padding=1,
                      kernel_size=6)
     _.o = nn.AvgPool2d(2, stride=2)
     _.bn3 = nn.BatchNorm2d(a)
     _.bn32 = nn.BatchNorm2d(d)
     _.bn64 = nn.BatchNorm2d(e)