Beispiel #1
0
    def __init__(self):
        self.conv0 = op.Encoder(3, 64, 3, 3, name='encoder0')
        self.conv1 = op.Encoder(64,
                                128,
                                4,
                                4,
                                strides=[1, 2, 2, 1],
                                name='encoder1')
        self.conv1_f1 = op.Encoder(128, 128, 3, 3, name='encoder1_flat1')
        self.conv1_f2 = op.Encoder(128, 128, 3, 3, name='encoder1_flat2')
        self.conv2 = op.Encoder(128,
                                256,
                                4,
                                4,
                                strides=[1, 2, 2, 1],
                                name='encoder2')
        self.conv2_f1 = op.Encoder(256, 256, 3, 3, name='encoder2_flat1')
        self.conv2_f2 = op.Encoder(256, 256, 3, 3, name='encoder2_flat2')
        self.conv3 = op.Encoder(256,
                                512,
                                4,
                                4,
                                strides=[1, 2, 2, 1],
                                name='encoder3')
        self.conv3_f1 = op.Encoder(512, 512, 3, 3, name='encoder3_flat1')
        self.conv3_f2 = op.Encoder(512, 512, 3, 3, name='encoder3_flat2')

        self.bnc0 = op.BatchNormalization(name='bnc0')
        self.bnc1 = op.BatchNormalization(name='bnc1')
        self.bnc1_f1 = op.BatchNormalization(name='bnc1_flat1')
        self.bnc1_f2 = op.BatchNormalization(name='bnc1_flat2')
        self.bnc2 = op.BatchNormalization(name='bnc2')
        self.bnc2_f1 = op.BatchNormalization(name='bnc2_flat1')
        self.bnc2_f2 = op.BatchNormalization(name='bnc2_flat2')
        self.bnc3 = op.BatchNormalization(name='bnc3')
        self.bnc3_f1 = op.BatchNormalization(name='bnc3_flat1')
        self.bnc3_f2 = op.BatchNormalization(name='bnc3_flat2')

        self.deconv3 = op.PixelShuffler(
            op.Encoder(512, 1024, 4, 4, name="decoder3"), 256, 2)
        self.deconv3_f1 = op.Encoder(256, 256, 3, 3, name='decoder3_flat1')
        self.deconv3_f2 = op.Encoder(256, 256, 3, 3, name='decoder3_flat2')
        self.deconv2 = op.PixelShuffler(None, 128, 2)
        self.deconv2_f1 = op.Encoder(128, 128, 3, 3, name='decoder2_flat1')
        self.deconv2_f2 = op.Encoder(128, 128, 3, 3, name='decoder2_flat2')
        self.deconv1 = op.PixelShuffler(None, 64, 2)
        self.deconv1_f1 = op.Encoder(64, 32, 3, 3, name='decoder1_flat1')
        self.deconv0 = op.Encoder(32, 1, 3, 3, name='decoder0')

        self.bnd3 = op.BatchNormalization(name='bnd3')
        self.bnd3_f1 = op.BatchNormalization(name='bnd3_flat1')
        self.bnd3_f2 = op.BatchNormalization(name='bnd3_flat2')
        self.bnd2 = op.BatchNormalization(name='bnd2')
        self.bnd2_f1 = op.BatchNormalization(name='bnd2_flat1')
        self.bnd2_f2 = op.BatchNormalization(name='bnd2_flat2')
        self.bnd1 = op.BatchNormalization(name='bnd1')
        self.bnd1_f1 = op.BatchNormalization(name='bnd1_flat1')
    def __init__(self):
        self.bnd1 = op.BatchNormalization(name='guide2_bnd1')
        self.bnd2 = op.BatchNormalization(name='guide2_bnd2')
        self.bnd3 = op.BatchNormalization(name='guide2_bnd3')

        self.deconv3 = op.PixelShuffler(
            op.Encoder(512, 512, 3, 3, name='guide2_decoder3'), 128, 2)
        self.deconv2 = op.PixelShuffler(
            op.Encoder(128, 256, 3, 3, name='guide2_decoder2'), 64, 2)
        self.deconv1 = op.PixelShuffler(
            op.Encoder(64, 128, 3, 3, name='guide2_decoder1'), 32, 2)
        self.deconv0 = op.Encoder(32, 3, 3, 3, name="guide2_decoder0")
    def __init__(self, channels):
        self.bnc1 = op.BatchNormalization(name='bnc1')
        self.bnc1_f = op.BatchNormalization(name='bnc1_f')
        self.bnc2 = op.BatchNormalization(name='bnc2')
        self.bnc2_f = op.BatchNormalization(name='bnc2_f')
        self.bnc3 = op.BatchNormalization(name='bnc3')
        self.bnc3_f = op.BatchNormalization(name='bnc3_f')

        self.bnd1 = op.BatchNormalization(name='bnd1')
        self.bnd1_f = op.BatchNormalization(name='bnd1_f')
        self.bnd2 = op.BatchNormalization(name='bnd2')
        self.bnd2_f = op.BatchNormalization(name='bnd2_f')
        self.bnd3 = op.BatchNormalization(name='bnd3')
        self.bnd3_f = op.BatchNormalization(name='bnd3_f')

        self.conv1 = op.Encoder(channels,
                                32,
                                3,
                                3,
                                strides=[1, 2, 2, 1],
                                name='encoder1')
        self.conv1_f1 = op.Encoder(32, 32, 3, 3, name="encoder1_f1")
        self.conv2 = op.Encoder(32,
                                64,
                                3,
                                3,
                                strides=[1, 2, 2, 1],
                                name='encoder2')
        self.conv2_f1 = op.Encoder(64, 64, 3, 3, name="encoder2_f1")
        self.conv3 = op.Encoder(64,
                                128,
                                3,
                                3,
                                strides=[1, 2, 2, 1],
                                name='encoder3')
        self.conv3_f1 = op.Encoder(128, 128, 3, 3, name="encoder3_f1")

        self.deconv3 = op.PixelShuffler(
            op.Encoder(128, 512, 3, 3, name='decoder3'), 128, 2)
        self.deconv3_f1 = op.Encoder(128, 128, 3, 3, name="decoder3_f1")
        self.deconv2 = op.PixelShuffler(
            op.Encoder(256, 256, 3, 3, name='decoder2'), 64, 2)
        self.deconv2_f1 = op.Encoder(64, 64, 3, 3, name="decoder2_f1")
        self.deconv1 = op.PixelShuffler(
            op.Encoder(128, 128, 3, 3, name='decoder1'), 32, 2)
        self.deconv1_f1 = op.Encoder(32, 32, 3, 3, name="decoder1_f1")
        self.deconv0 = op.Encoder(32, 3, 3, 3, name="decoder0")

        self.fully_connect = op.Dense('fully_connect')
        self.fully_unconnect = op.Dense('fully_unconnect')
Beispiel #4
0
    def __init__(self, inference_channels, original_channels, recursives=5):
        self.bnc1 = op.BatchNormalization(name='upsampler/bnc1')
        self.bnc2 = op.BatchNormalization(name='upsampler/bnc2')

        self.conv1 = op.PixelShuffler(
            op.Encoder(inference_channels * 2,
                       256,
                       3,
                       3,
                       name='upsampler/encoder1'), 64, 2)
        self.conv2 = op.PixelShuffler(
            op.Encoder(64, 128, 3, 3, name="upsampler/encoder2"), 32, 2)
        self.conv3 = op.Encoder(32, 3, 3, 3, name="upsampler/encoder3")

        self.recursives = recursives
Beispiel #5
0
    def __init__(self, channels):
        self.bnc1 = op.BatchNormalization(name='upsampler/bnc1')
        self.bnc2 = op.BatchNormalization(name='upsampler/bnc2')
        self.bnc3 = op.BatchNormalization(name='upsampler/bnc3')
        self.bnc4 = op.BatchNormalization(name='upsampler/bnc4')

        self.conv1 = op.Encoder(channels, 256, 3, 3, name='upsampler/encoder0')

        self.conv2 = op.PixelShuffler(
            op.Encoder(256, 1024, 3, 3, name='upsampler/encoder1'), 256, 2)
        self.resnet1 = op.ResNet(256, name='upsampler/resnet1')
        self.conv3 = op.Encoder(256, 128, 3, 3, name='upsampler/encoder3')
        self.resnet2 = op.PixelShuffler(
            op.ResNet(128, name='upsampler/resnet2'), 32, 2)
        self.resnet3 = op.ResNet(32, name='upsampler/resnet3')
        self.conv4 = op.Encoder(32, 3, 3, 3, name='upsampler/encoder4')
Beispiel #6
0
    def __init__(self):
        self.bnd1 = op.BatchNormalization(name='bnd2')
        self.bnd2 = op.BatchNormalization(name='bnd3')
        self.bnd3 = op.BatchNormalization(name='bnd4')
        self.bnd4 = op.BatchNormalization(name='bnd5')

        self.deconv4 = op.PixelShuffler(
            op.Encoder(512, 1024, 3, 3, name='decoder4'), 256, 2)
        self.deconv3 = op.PixelShuffler(
            op.Encoder(256, 512, 3, 3, name='decoder3'), 128, 2)
        self.deconv2 = op.PixelShuffler(
            op.Encoder(128, 256, 3, 3, name='decoder2'), 64, 2)
        self.deconv1 = op.PixelShuffler(
            op.Encoder(64, 128, 3, 3, name='decoder1'), 32, 2)
        self.deconv0 = op.Encoder(32, 3, 3, 3, name="decoder0")

        self.dense = op.Dense('dense')
Beispiel #7
0
    def __init__(self):
        self.conv1 = op.Encoder(3, 48, 5, 5, strides=[1, 2, 2, 1], name='encoder1')
        self.conv1_f1 = op.Encoder(48, 128, 3, 3, name='encoder1_flat1')
        self.conv1_f2 = op.Encoder(128, 128, 3, 3, name='encoder1_flat2')
        self.conv2 = op.Encoder(128, 256, 5, 5, strides=[1, 2, 2, 1], name='encoder2')
        self.conv2_f1 = op.Encoder(256, 256, 3, 3, name='encoder2_flat1')
        self.conv2_f2 = op.Encoder(256, 256, 3, 3, name='encoder2_flat2')
        self.conv3 = op.Encoder(256, 256, 5, 5, strides=[1, 2, 2, 1], name='encoder3')
        self.conv3_f1 = op.Encoder(256, 512, 3, 3, name='encoder3_flat1')
        self.conv3_f2 = op.Encoder(512, 1024, 3, 3, name='encoder3_flat2')
        self.conv3_f3 = op.Encoder(1024, 512, 3, 3, name='encoder3_flat3')
        self.conv3_f4 = op.Encoder(512, 256, 3, 3, name='encoder3_flat4')

        self.bnc1 = op.BatchNormalization(name='bnc1')
        self.bnc1_f1 = op.BatchNormalization(name='bnc1_flat1')
        self.bnc1_f2 = op.BatchNormalization(name='bnc1_flat2')
        self.bnc2 = op.BatchNormalization(name='bnc2')
        self.bnc2_f1 = op.BatchNormalization(name='bnc2_flat1')
        self.bnc2_f2 = op.BatchNormalization(name='bnc2_flat2')
        self.bnc3 = op.BatchNormalization(name='bnc3')
        self.bnc3_f1 = op.BatchNormalization(name='bnc3_flat1')
        self.bnc3_f2 = op.BatchNormalization(name='bnc3_flat2')
        self.bnc3_f3 = op.BatchNormalization(name='bnc3_flat3')
        self.bnc3_f4 = op.BatchNormalization(name='bnc3_flat4')

        self.deconv3 = op.PixelShuffler(op.Encoder(256, 1024, 3, 3, name='decoder3'), 256, 2)
        self.deconv3_f1 = op.Encoder(256, 128, 3, 3, name='decoder3_flat1')
        self.deconv3_f2 = op.Encoder(128, 128, 3, 3, name='decoder3_flat2')
        self.deconv2 = op.PixelShuffler(op.Encoder(128, 512, 3, 3, name='decoder2'), 128, 2)
        self.deconv2_f1 = op.Encoder(128, 48, 3, 3, name='decoder2_flat1')
        self.deconv2_f2 = op.Encoder(48, 48, 3, 3, name='decoder2_flat2')
        self.deconv1 = op.PixelShuffler(op.Encoder(48, 192, 3, 3, name='decoder1'), 48, 2)
        self.deconv1_f1 = op.Encoder(48, 24, 3, 3, name='decoder1_flat1')
        self.deconv1_f2 = op.Encoder(24, 24, 3, 3, name='decoder1_flat2')
        self.deconv0 = op.Encoder(24, 1, 3, 3, name='decoder0')

        self.bnd3 = op.BatchNormalization(name='bnd3')
        self.bnd3_f1 = op.BatchNormalization(name='bnd3_flat1')
        self.bnd3_f2 = op.BatchNormalization(name='bnd3_flat2')
        self.bnd2 = op.BatchNormalization(name='bnd2')
        self.bnd2_f1 = op.BatchNormalization(name='bnd2_flat1')
        self.bnd2_f2 = op.BatchNormalization(name='bnd2_flat2')
        self.bnd1 = op.BatchNormalization(name='bnd1')
        self.bnd1_f1 = op.BatchNormalization(name='bnd1_flat1')
        self.bnd1_f2 = op.BatchNormalization(name='bnd1_flat2')
Beispiel #8
0
    def __init__(self, embedding_channels):
        self.enc1 = op.Encoder(3, 64, 3, 3, strides=[1, 2, 2, 1], name='encoder/1')
        self.enc2 = op.Encoder(64, 128, 3, 3, strides=[1, 2, 2, 1], name='encoder/2')
        self.enc3 = op.Encoder(128, 256, 3, 3, strides=[1, 2, 2, 1], name='encoder/3')
        self.enc4 = op.Encoder(256, 512, 3, 3, strides=[1, 1, 1, 1], name='encoder/4')

        self.dec4 = op.PixelShuffler(op.Encoder(512 + embedding_channels, 1024, 3, 3, name='decoder/4'), 256, 2)
        self.dec3 = op.PixelShuffler(op.Encoder(256, 512, 3, 3, name='decoder/3'), 128, 2)
        self.dec2 = op.PixelShuffler(op.Encoder(128, 256, 3, 3, name='decoder/2'), 64, 2)
        self.dec1 = op.Encoder(64, 3, 3, 3, name='decoder/1')

        self.bnd1 = op.BatchNormalization(name='bnd/1')
        self.bnd2 = op.BatchNormalization(name='bnd/2')
        self.bnd3 = op.BatchNormalization(name='bnd/3')

        self.bnc1 = op.BatchNormalization(name='bnc/1')
        self.bnc2 = op.BatchNormalization(name='bnc/2')
        self.bnc3 = op.BatchNormalization(name='bnc/3')
        self.bnc4 = op.BatchNormalization(name='bnc/4')
Beispiel #9
0
    def __init__(self, channels):
        self.bnc0 = op.BatchNormalization(name='bnc0')
        self.bnc1 = op.BatchNormalization(name='bnc1')
        self.bnc2 = op.BatchNormalization(name='bnc2')
        self.bnc3 = op.BatchNormalization(name='bnc3')
        self.bnc4 = op.BatchNormalization(name='bnc4')
        self.bnc5 = op.BatchNormalization(name='bnc5')
        self.bnc6 = op.BatchNormalization(name='bnc6')
        self.bnc7 = op.BatchNormalization(name='bnc7')
        self.bnc8 = op.BatchNormalization(name='bnc8')

        self.bnd1 = op.BatchNormalization(name='bnd1')
        self.bnd2 = op.BatchNormalization(name='bnd2')
        self.bnd3 = op.BatchNormalization(name='bnd3')
        self.bnd4 = op.BatchNormalization(name='bnd4')
        self.bnd5 = op.BatchNormalization(name='bnd5')
        self.bnd6 = op.BatchNormalization(name='bnd6')
        self.bnd7 = op.BatchNormalization(name='bnd7')
        self.bnd8 = op.BatchNormalization(name='bnd8')

        self.conv0 = op.Encoder(channels,
                                32,
                                3,
                                3,
                                strides=[1, 1, 1, 1],
                                name='encoder0')
        self.conv1 = op.Encoder(32,
                                64,
                                4,
                                4,
                                strides=[1, 2, 2, 1],
                                name='encoder1')
        self.conv2 = op.Encoder(64,
                                64,
                                3,
                                3,
                                strides=[1, 1, 1, 1],
                                name='encoder2')
        self.conv3 = op.Encoder(64,
                                128,
                                4,
                                4,
                                strides=[1, 2, 2, 1],
                                name='encoder3')
        self.conv4 = op.Encoder(128,
                                128,
                                3,
                                3,
                                strides=[1, 1, 1, 1],
                                name='encoder4')
        self.conv5 = op.Encoder(128,
                                256,
                                4,
                                4,
                                strides=[1, 2, 2, 1],
                                name='encoder5')
        self.conv6 = op.Encoder(256,
                                256,
                                3,
                                3,
                                strides=[1, 1, 1, 1],
                                name='encoder6')
        self.conv7 = op.Encoder(256,
                                512,
                                4,
                                4,
                                strides=[1, 2, 2, 1],
                                name='encoder7')
        self.conv8 = op.Encoder(512,
                                512,
                                3,
                                3,
                                strides=[1, 1, 1, 1],
                                name='encoder8')

        self.deconv8 = op.PixelShuffler(
            op.Encoder(1152, 1024, 3, 3, name='decoder8'), 256, 2)
        self.deconv7 = op.Encoder(256, 256, 3, 3, name='decoder7')
        self.deconv6 = op.PixelShuffler(
            op.Encoder(512, 512, 3, 3, name='decoder6'), 128, 2)
        self.deconv5 = op.Encoder(128, 128, 3, 3, name='decoder5')
        self.deconv4 = op.PixelShuffler(
            op.Encoder(256, 256, 3, 3, name='decoder4'), 64, 2)
        self.deconv3 = op.Encoder(64, 64, 3, 3, name='decoder3')
        self.deconv2 = op.PixelShuffler(
            op.Encoder(128, 128, 3, 3, name='decoder2'), 32, 2)
        self.deconv1 = op.Encoder(32, 32, 3, 3, name='decoder1')
        self.deconv0 = op.Encoder(64, 3, 3, 3, name='decoder0')