models/dense_net.py
def transition_layer(self, _input, block):
        """
        Adds a new transition layer after a block. This layer's inputs are the
        concatenated feature maps of each layer in the block.

        The layer first runs the composite function with kernel size 1:
        - In DenseNet mode, it produces as many feature maps as the input had.
        - In DenseNet-BC mode, it produces reduction (theta) times as many,
          compressing the output.
        Afterwards, an average pooling operation (of size 2) is carried to
        change the output's size.

        Args:
            _input: tensor, the operation's input;
            block: `int`, identifier number for the previous block.
        """
        with tf.variable_scope("Transition_after_block_%d" % block):
            # add feature map compression in DenseNet-BC mode
            out_features = int(int(_input.get_shape()[-1]) * self.reduction)
            # use the composite function H_l (1x1 kernel conv)
            output, filter_ref, kernels, in_cv = self.composite_function(
                _input, out_features=out_features, kernel_size=1)
            # save a reference to the composite function's filter
            if self.ft_filters or self.should_self_construct:
                self.filter_ref_list[-1].append(filter_ref)
            if self.ft_kernels or self.should_self_construct:
                self.kernels_ref_list[-1].append(kernels)
            # use average pooling to reduce feature map size
            output = self.avg_pool(output, k=2)
        return output

        Adds a new transition layer after a block. This layer's inputs are the
        concatenated feature maps of each layer in the block.

        The layer first runs the composite function with kernel size 1:
        - In DenseNet mode, it produces as many feature maps as the input had.
        - In DenseNet-BC mode, it produces reduction (theta) times as many,
          compressing the output.
        Afterwards, an average pooling operation (of size 2) is carried to
        change the output's size.

        Args:
            _input: tensor, the operation's input;
            block: `int`, identifier number for the previous block.
        
Adds a new transition layer after a block. This layer's inputs are the
concatenated feature maps of each layer in the block.

The layer first runs the composite function with kernel size 1:
In DenseNet mode, it produces as many feature maps as the input had.
In DenseNet-BC mode, it produces reduction (theta) times as many,
compressing the output.
Afterwards, an average pooling operation (of size 2) is carried to
change the output's size.
Adds a new transition layer after a block . This layer ' s inputs are the concatenated feature maps of each layer in the block . The layer first runs the composite function with kernel size 1 : In DenseNet mode it produces as many feature maps as the input had . In DenseNet - BC mode it produces reduction ( theta ) times as many compressing the output . Afterwards an average pooling operation ( of size 2 ) is carried to change the output ' s size .
def transition_layer(self, _input, block):
        with tf.variable_scope("Transition_after_block_%d" % block):
            out_features = int(int(_input.get_shape()[-1]) * self.reduction)
            output, filter_ref, kernels, in_cv = self.composite_function(
                _input, out_features=out_features, kernel_size=1)
            if self.ft_filters or self.should_self_construct:
                self.filter_ref_list[-1].append(filter_ref)
            if self.ft_kernels or self.should_self_construct:
                self.kernels_ref_list[-1].append(kernels)
            output = self.avg_pool(output, k=2)
        return output
def transition_layer ( self , _input , block ) : with tf . variable_scope ( "Transition_after_block_%d" % block ) : out_features = int ( int ( _input . get_shape ( ) [ - 1 ] ) * self . reduction ) output , filter_ref , kernels , in_cv = self . composite_function ( _input , out_features = out_features , kernel_size = 1 ) if self . ft_filters or self . should_self_construct : self . filter_ref_list [ - 1 ] . append ( filter_ref ) if self . ft_kernels or self . should_self_construct : self . kernels_ref_list [ - 1 ] . append ( kernels ) output = self . avg_pool ( output , k = 2 ) return output
Adds a new transition layer after a block.
Adds a new transition layer after a block .
"""
        Adds a new transition layer after a block. This layer's inputs are the
        concatenated feature maps of each layer in the block.

        The layer first runs the composite function with kernel size 1:
        - In DenseNet mode, it produces as many feature maps as the input had.
        - In DenseNet-BC mode, it produces reduction (theta) times as many,
          compressing the output.
        Afterwards, an average pooling operation (of size 2) is carried to
        change the output's size.

        Args:
            _input: tensor, the operation's input;
            block: `int`, identifier number for the previous block.
        """ # add feature map compression in DenseNet-BC mode # use the composite function H_l (1x1 kernel conv) # save a reference to the composite function's filter # use average pooling to reduce feature map size
self
_input
tensor, the operation's input.
tensor the operation ' s input .
block
`int`, identifier number for the previous block.
` int ` identifier number for the previous block .