nn/unet.py
def create_graph(self, feature, **kwargs):
        """
        Create graph for the U-Net
        :param feature: input image
        :param start_filter_num: #filters at the start layer, #filters in U-Net grows exponentially
        :return:
        """
        sfn = self.sfn

        # downsample
        conv1, pool1 = nn_utils.conv_conv_pool(feature, [sfn, sfn], self.mode, name='conv1',
                                               padding='valid', dropout=self.dropout_rate)
        conv2, pool2 = nn_utils.conv_conv_pool(pool1, [sfn * 2, sfn * 2], self.mode, name='conv2',
                                               padding='valid', dropout=self.dropout_rate)
        conv3, pool3 = nn_utils.conv_conv_pool(pool2, [sfn * 4, sfn * 4], self.mode, name='conv3',
                                               padding='valid', dropout=self.dropout_rate)
        conv4, pool4 = nn_utils.conv_conv_pool(pool3, [sfn * 8, sfn * 8], self.mode, name='conv4',
                                               padding='valid', dropout=self.dropout_rate)
        conv5 = nn_utils.conv_conv_pool(pool4, [sfn * 16, sfn * 16], self.mode, name='conv5', pool=False,
                                                padding='valid', dropout=self.dropout_rate)

        # upsample
        up6 = nn_utils.crop_upsample_concat(conv5, conv4, 8, name='6')
        conv6 = nn_utils.conv_conv_pool(up6, [sfn * 8, sfn * 8], self.mode, name='up6', pool=False,
                                        padding='valid', dropout=self.dropout_rate)
        up7 = nn_utils.crop_upsample_concat(conv6, conv3, 32,name='7')
        conv7 = nn_utils.conv_conv_pool(up7, [sfn * 4, sfn * 4], self.mode, name='up7', pool=False,
                                        padding='valid', dropout=self.dropout_rate)
        up8 = nn_utils.crop_upsample_concat(conv7, conv2, 80, name='8')
        conv8 = nn_utils.conv_conv_pool(up8, [sfn * 2, sfn * 2], self.mode, name='up8', pool=False,
                                        padding='valid', dropout=self.dropout_rate)
        up9 = nn_utils.crop_upsample_concat(conv8, conv1, 176, name='9')
        conv9 = nn_utils.conv_conv_pool(up9, [sfn, sfn], self.mode, name='up9', pool=False,
                                        padding='valid', dropout=self.dropout_rate)

        self.pred = tf.layers.conv2d(conv9, self.class_num, (1, 1), name='final', activation=None, padding='same')
        self.output = tf.nn.softmax(self.pred)

        Create graph for the U-Net
        :param feature: input image
        :param start_filter_num: #filters at the start layer, #filters in U-Net grows exponentially
        :return:
        
Create graph for the U-Net
Create graph for the U - Net
def create_graph(self, feature, **kwargs):
        sfn = self.sfn
        conv1, pool1 = nn_utils.conv_conv_pool(feature, [sfn, sfn], self.mode, name='conv1',
                                               padding='valid', dropout=self.dropout_rate)
        conv2, pool2 = nn_utils.conv_conv_pool(pool1, [sfn * 2, sfn * 2], self.mode, name='conv2',
                                               padding='valid', dropout=self.dropout_rate)
        conv3, pool3 = nn_utils.conv_conv_pool(pool2, [sfn * 4, sfn * 4], self.mode, name='conv3',
                                               padding='valid', dropout=self.dropout_rate)
        conv4, pool4 = nn_utils.conv_conv_pool(pool3, [sfn * 8, sfn * 8], self.mode, name='conv4',
                                               padding='valid', dropout=self.dropout_rate)
        conv5 = nn_utils.conv_conv_pool(pool4, [sfn * 16, sfn * 16], self.mode, name='conv5', pool=False,
                                                padding='valid', dropout=self.dropout_rate)
        up6 = nn_utils.crop_upsample_concat(conv5, conv4, 8, name='6')
        conv6 = nn_utils.conv_conv_pool(up6, [sfn * 8, sfn * 8], self.mode, name='up6', pool=False,
                                        padding='valid', dropout=self.dropout_rate)
        up7 = nn_utils.crop_upsample_concat(conv6, conv3, 32,name='7')
        conv7 = nn_utils.conv_conv_pool(up7, [sfn * 4, sfn * 4], self.mode, name='up7', pool=False,
                                        padding='valid', dropout=self.dropout_rate)
        up8 = nn_utils.crop_upsample_concat(conv7, conv2, 80, name='8')
        conv8 = nn_utils.conv_conv_pool(up8, [sfn * 2, sfn * 2], self.mode, name='up8', pool=False,
                                        padding='valid', dropout=self.dropout_rate)
        up9 = nn_utils.crop_upsample_concat(conv8, conv1, 176, name='9')
        conv9 = nn_utils.conv_conv_pool(up9, [sfn, sfn], self.mode, name='up9', pool=False,
                                        padding='valid', dropout=self.dropout_rate)
        self.pred = tf.layers.conv2d(conv9, self.class_num, (1, 1), name='final', activation=None, padding='same')
        self.output = tf.nn.softmax(self.pred)
def create_graph ( self , feature , ** kwargs ) : sfn = self . sfn conv1 , pool1 = nn_utils . conv_conv_pool ( feature , [ sfn , sfn ] , self . mode , name = 'conv1' , padding = 'valid' , dropout = self . dropout_rate ) conv2 , pool2 = nn_utils . conv_conv_pool ( pool1 , [ sfn * 2 , sfn * 2 ] , self . mode , name = 'conv2' , padding = 'valid' , dropout = self . dropout_rate ) conv3 , pool3 = nn_utils . conv_conv_pool ( pool2 , [ sfn * 4 , sfn * 4 ] , self . mode , name = 'conv3' , padding = 'valid' , dropout = self . dropout_rate ) conv4 , pool4 = nn_utils . conv_conv_pool ( pool3 , [ sfn * 8 , sfn * 8 ] , self . mode , name = 'conv4' , padding = 'valid' , dropout = self . dropout_rate ) conv5 = nn_utils . conv_conv_pool ( pool4 , [ sfn * 16 , sfn * 16 ] , self . mode , name = 'conv5' , pool = False , padding = 'valid' , dropout = self . dropout_rate ) up6 = nn_utils . crop_upsample_concat ( conv5 , conv4 , 8 , name = '6' ) conv6 = nn_utils . conv_conv_pool ( up6 , [ sfn * 8 , sfn * 8 ] , self . mode , name = 'up6' , pool = False , padding = 'valid' , dropout = self . dropout_rate ) up7 = nn_utils . crop_upsample_concat ( conv6 , conv3 , 32 , name = '7' ) conv7 = nn_utils . conv_conv_pool ( up7 , [ sfn * 4 , sfn * 4 ] , self . mode , name = 'up7' , pool = False , padding = 'valid' , dropout = self . dropout_rate ) up8 = nn_utils . crop_upsample_concat ( conv7 , conv2 , 80 , name = '8' ) conv8 = nn_utils . conv_conv_pool ( up8 , [ sfn * 2 , sfn * 2 ] , self . mode , name = 'up8' , pool = False , padding = 'valid' , dropout = self . dropout_rate ) up9 = nn_utils . crop_upsample_concat ( conv8 , conv1 , 176 , name = '9' ) conv9 = nn_utils . conv_conv_pool ( up9 , [ sfn , sfn ] , self . mode , name = 'up9' , pool = False , padding = 'valid' , dropout = self . dropout_rate ) self . pred = tf . layers . conv2d ( conv9 , self . class_num , ( 1 , 1 ) , name = 'final' , activation = None , padding = 'same' ) self . output = tf . nn . softmax ( self . pred )
Create graph for the U-Net
Create graph for the U - Net
"""
        Create graph for the U-Net
        :param feature: input image
        :param start_filter_num: #filters at the start layer, #filters in U-Net grows exponentially
        :return:
        """ # downsample # upsample
None
self
feature
None
start_filter_num
filters at the start layer, #filters in U-Net grows exponentially
filters at the start layer #filters in U - Net grows exponentially