models/dense_net.py
def conv2d_with_kernels(self, _input, out_features, kernel_size,
                            strides=[1, 1, 1, 1], padding='SAME'):
        """
        Creates a 2d convolutional filter layer, by producing a list of 3d
        kernels and then stacking them together to create the filter.
        Returns the output of the layer and a reference to its convolutional
        filter, as well as the newly generated list of kernels.

        Args:
            _input: tensor, the operation's input;
            out_features: `int`, number of feature maps at the output;
            kernel_size: `int`, size of the square kernels (their side);
            strides: `list` of `int`, strides in each direction for kernels;
            padding: `str`, should we use padding ('SAME') or not ('VALID').
        """
        in_features = int(_input.get_shape()[-1])
        # First create a list with the 3d kernels (easily modifiable):
        kernels = []
        for o in range(out_features):
            kernels.append(self.weight_variable_msra(
                [kernel_size, kernel_size, in_features], name='kernel'+str(o)))
        # The kernels are stacked together so as to create a 4d filter
        # (dimension 3 = output features).
        filter_ref = tf.stack(kernels, axis=3, name='filter')
        # Using the filter, the convolution is defined.
        output = tf.nn.conv2d(_input, filter_ref, strides, padding)
        return output, filter_ref, kernels

        Creates a 2d convolutional filter layer, by producing a list of 3d
        kernels and then stacking them together to create the filter.
        Returns the output of the layer and a reference to its convolutional
        filter, as well as the newly generated list of kernels.

        Args:
            _input: tensor, the operation's input;
            out_features: `int`, number of feature maps at the output;
            kernel_size: `int`, size of the square kernels (their side);
            strides: `list` of `int`, strides in each direction for kernels;
            padding: `str`, should we use padding ('SAME') or not ('VALID').
        
Creates a 2d convolutional filter layer, by producing a list of 3d
kernels and then stacking them together to create the filter.
Returns the output of the layer and a reference to its convolutional
filter, as well as the newly generated list of kernels.
Creates a 2d convolutional filter layer by producing a list of 3d kernels and then stacking them together to create the filter . Returns the output of the layer and a reference to its convolutional filter as well as the newly generated list of kernels .
def conv2d_with_kernels(self, _input, out_features, kernel_size,
                            strides=[1, 1, 1, 1], padding='SAME'):
        in_features = int(_input.get_shape()[-1])
        kernels = []
        for o in range(out_features):
            kernels.append(self.weight_variable_msra(
                [kernel_size, kernel_size, in_features], name='kernel'+str(o)))
        filter_ref = tf.stack(kernels, axis=3, name='filter')
        output = tf.nn.conv2d(_input, filter_ref, strides, padding)
        return output, filter_ref, kernels
def conv2d_with_kernels ( self , _input , out_features , kernel_size , strides = [ 1 , 1 , 1 , 1 ] , padding = 'SAME' ) : in_features = int ( _input . get_shape ( ) [ - 1 ] ) kernels = [ ] for o in range ( out_features ) : kernels . append ( self . weight_variable_msra ( [ kernel_size , kernel_size , in_features ] , name = 'kernel' + str ( o ) ) ) filter_ref = tf . stack ( kernels , axis = 3 , name = 'filter' ) output = tf . nn . conv2d ( _input , filter_ref , strides , padding ) return output , filter_ref , kernels
Creates a 2d convolutional filter layer, by producing a list of 3d
kernels and then stacking them together to create the filter.
Creates a 2d convolutional filter layer by producing a list of 3d kernels and then stacking them together to create the filter .
"""
        Creates a 2d convolutional filter layer, by producing a list of 3d
        kernels and then stacking them together to create the filter.
        Returns the output of the layer and a reference to its convolutional
        filter, as well as the newly generated list of kernels.

        Args:
            _input: tensor, the operation's input;
            out_features: `int`, number of feature maps at the output;
            kernel_size: `int`, size of the square kernels (their side);
            strides: `list` of `int`, strides in each direction for kernels;
            padding: `str`, should we use padding ('SAME') or not ('VALID').
        """ # First create a list with the 3d kernels (easily modifiable): # The kernels are stacked together so as to create a 4d filter # (dimension 3 = output features). # Using the filter, the convolution is defined.
self
_input
tensor, the operation's input.
tensor the operation ' s input .
out_features
`int`, number of feature maps at the output.
` int ` number of feature maps at the output .
kernel_size
`int`, size of the square kernels (their side).
` int ` size of the square kernels ( their side ) .
strides
`list` of `int`, strides in each direction for kernels.
` list ` of ` int ` strides in each direction for kernels .
padding
`str`, should we use padding ('SAME') or not ('VALID').
` str ` should we use padding ( ' SAME ' ) or not ( ' VALID ' ) .