models/dense_net.py
def add_block(self, _input, block, growth_rate, layers_in_block, is_last):
        """
        Adds a new block containing several convolutional (dense) layers.
        These are connected together following a DenseNet architecture,
        as defined in the paper.
        Returns the block's output, as well as the inputs to the last layer
        and to its conv2d.

        Args:
            _input: tensor, the operation's input;
            block: `int`, identifier number for this block;
            growth_rate: `int`, number of new convolutions per dense layer;
            layers_in_block: `int`, number of dense layers in this block;
            is_last: `bool`, is this the last block in the network or not.
        """
        if self.ft_filters or self.should_self_construct:
            self.filter_ref_list.append([])
        if self.ft_kernels or self.should_self_construct:
            self.kernels_ref_list.append([])
        if is_last:
            self.cross_entropy = []

        with tf.variable_scope("Block_%d" % block) as self.current_block:
            output = _input
            for layer in range(layers_in_block):
                # The inputs of the last layer and its conv2d must be saved
                # (useful for self-construction kernel by kernel)
                input_lt_lay = output
                output, input_lt_cnv = self.add_internal_layer(
                    input_lt_lay, layer, growth_rate)

                if self.ft_cross_entropies and is_last:
                    # Save the cross-entropy for all layers except the last one
                    # (it is always saved as part of the end-graph operations)
                    if layer != layers_in_block-1:
                        _, cross_entropy = self.cross_entropy_loss(
                            output, self.labels, block, layer,
                            preserve_transition=self.preserve_transition_l)
                        self.cross_entropy.append(cross_entropy)

        return output, input_lt_lay, input_lt_cnv

        Adds a new block containing several convolutional (dense) layers.
        These are connected together following a DenseNet architecture,
        as defined in the paper.
        Returns the block's output, as well as the inputs to the last layer
        and to its conv2d.

        Args:
            _input: tensor, the operation's input;
            block: `int`, identifier number for this block;
            growth_rate: `int`, number of new convolutions per dense layer;
            layers_in_block: `int`, number of dense layers in this block;
            is_last: `bool`, is this the last block in the network or not.
        
Adds a new block containing several convolutional (dense) layers.
These are connected together following a DenseNet architecture,
as defined in the paper.
Returns the block's output, as well as the inputs to the last layer
and to its conv2d.
Adds a new block containing several convolutional ( dense ) layers . These are connected together following a DenseNet architecture as defined in the paper . Returns the block ' s output as well as the inputs to the last layer and to its conv2d .
def add_block(self, _input, block, growth_rate, layers_in_block, is_last):
        if self.ft_filters or self.should_self_construct:
            self.filter_ref_list.append([])
        if self.ft_kernels or self.should_self_construct:
            self.kernels_ref_list.append([])
        if is_last:
            self.cross_entropy = []
        with tf.variable_scope("Block_%d" % block) as self.current_block:
            output = _input
            for layer in range(layers_in_block):
                input_lt_lay = output
                output, input_lt_cnv = self.add_internal_layer(
                    input_lt_lay, layer, growth_rate)
                if self.ft_cross_entropies and is_last:
                    if layer != layers_in_block-1:
                        _, cross_entropy = self.cross_entropy_loss(
                            output, self.labels, block, layer,
                            preserve_transition=self.preserve_transition_l)
                        self.cross_entropy.append(cross_entropy)
        return output, input_lt_lay, input_lt_cnv
def add_block ( self , _input , block , growth_rate , layers_in_block , is_last ) : if self . ft_filters or self . should_self_construct : self . filter_ref_list . append ( [ ] ) if self . ft_kernels or self . should_self_construct : self . kernels_ref_list . append ( [ ] ) if is_last : self . cross_entropy = [ ] with tf . variable_scope ( "Block_%d" % block ) as self . current_block : output = _input for layer in range ( layers_in_block ) : input_lt_lay = output output , input_lt_cnv = self . add_internal_layer ( input_lt_lay , layer , growth_rate ) if self . ft_cross_entropies and is_last : if layer != layers_in_block - 1 : _ , cross_entropy = self . cross_entropy_loss ( output , self . labels , block , layer , preserve_transition = self . preserve_transition_l ) self . cross_entropy . append ( cross_entropy ) return output , input_lt_lay , input_lt_cnv
Adds a new block containing several convolutional (dense) layers.
Adds a new block containing several convolutional ( dense ) layers .
"""
        Adds a new block containing several convolutional (dense) layers.
        These are connected together following a DenseNet architecture,
        as defined in the paper.
        Returns the block's output, as well as the inputs to the last layer
        and to its conv2d.

        Args:
            _input: tensor, the operation's input;
            block: `int`, identifier number for this block;
            growth_rate: `int`, number of new convolutions per dense layer;
            layers_in_block: `int`, number of dense layers in this block;
            is_last: `bool`, is this the last block in the network or not.
        """ # The inputs of the last layer and its conv2d must be saved # (useful for self-construction kernel by kernel) # Save the cross-entropy for all layers except the last one # (it is always saved as part of the end-graph operations)
self
_input
tensor, the operation's input.
tensor the operation ' s input .
block
`int`, identifier number for this block.
` int ` identifier number for this block .
growth_rate
`int`, number of new convolutions per dense layer.
` int ` number of new convolutions per dense layer .
layers_in_block
`int`, number of dense layers in this block.
` int ` number of dense layers in this block .
is_last
`bool`, is this the last block in the network or not.
` bool ` is this the last block in the network or not .