parameters: (inputs,
               num_classes=1000,
               dropout_keep_prob=0.5,
               is_training=True,
               spatial_squeeze=True,
               scope='overfeat')
docstring: Contains the model definition for the OverFeat network.
  
    The definition for the network was obtained from:
      OverFeat: Integrated Recognition, Localization and Detection using
      Convolutional Networks
      Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus and
      Yann LeCun, 2014
      http://arxiv.org/abs/1312.6229
  
    Note: All the fully_connected layers have been transformed to conv2d layers.
          To use in classification mode, resize input to 231x231. To use in fully
          convolutional mode, set spatial_squeeze to false.
  
    Args:
      inputs: a tensor of size [batch_size, height, width, channels].
      num_classes: number of predicted classes.
      dropout_keep_prob: the probability that activations are kept in the dropout
        layers during training.
      is_training: whether or not the model is being trained.
      spatial_squeeze: whether or not should squeeze the spatial dimensions of the
        outputs. Useful to remove unnecessary dimensions for classification.
      scope: Optional scope for the variables.
  
    Returns:
      the last op containing the log predictions and end_points dict.
docstring_summary: Contains the model definition for the OverFeat network.
docstring_tokens: Contains the model definition for the OverFeat network .
function: def overfeat(inputs,
               num_classes=1000,
               dropout_keep_prob=0.5,
               is_training=True,
               spatial_squeeze=True,
               scope='overfeat'):
    """Contains the model definition for the OverFeat network.
  
    The definition for the network was obtained from:
      OverFeat: Integrated Recognition, Localization and Detection using
      Convolutional Networks
      Pierre Sermanet, David Eigen, Xiang Zhang, Michael Mathieu, Rob Fergus and
      Yann LeCun, 2014
      http://arxiv.org/abs/1312.6229
  
    Note: All the fully_connected layers have been transformed to conv2d layers.
          To use in classification mode, resize input to 231x231. To use in fully
          convolutional mode, set spatial_squeeze to false.
  
    Args:
      inputs: a tensor of size [batch_size, height, width, channels].
      num_classes: number of predicted classes.
      dropout_keep_prob: the probability that activations are kept in the dropout
        layers during training.
      is_training: whether or not the model is being trained.
      spatial_squeeze: whether or not should squeeze the spatial dimensions of the
        outputs. Useful to remove unnecessary dimensions for classification.
      scope: Optional scope for the variables.
  
    Returns:
      the last op containing the log predictions and end_points dict.
  
    """
    with tf.variable_op_scope([inputs], scope, 'overfeat') as sc:
      end_points_collection = sc.name + '_end_points'
      # Collect outputs for conv2d, fully_connected and max_pool2d
      with slim.arg_scope([slim.conv2d, slim.fully_connected, slim.max_pool2d],
                          outputs_collections=end_points_collection):
        net = slim.conv2d(inputs, 64, [11, 11], 4, padding='VALID',
                          scope='conv1')
        net = slim.max_pool2d(net, [2, 2], scope='pool1')
        net = slim.conv2d(net, 256, [5, 5], padding='VALID', scope='conv2')
        net = slim.max_pool2d(net, [2, 2], scope='pool2')
        net = slim.conv2d(net, 512, [3, 3], scope='conv3')
        net = slim.conv2d(net, 1024, [3, 3], scope='conv4')
        net = slim.conv2d(net, 1024, [3, 3], scope='conv5')
        net = slim.max_pool2d(net, [2, 2], scope='pool5')
        with slim.arg_scope([slim.conv2d],
                            weights_initializer=trunc_normal(0.005),
                            biases_initializer=tf.constant_initializer(0.1)):
          # Use conv2d instead of fully_connected layers.
          net = slim.conv2d(net, 3072, [6, 6], padding='VALID', scope='fc6')
          net = slim.dropout(net, dropout_keep_prob, is_training=is_training,
                             scope='dropout6')
          net = slim.conv2d(net, 4096, [1, 1], scope='fc7')
          net = slim.dropout(net, dropout_keep_prob, is_training=is_training,
                             scope='dropout7')
          net = slim.conv2d(net, num_classes, [1, 1],
                            activation_fn=None,
                            normalizer_fn=None,
                            biases_initializer=tf.zeros_initializer,
                            scope='fc8')
        # Convert end_points_collection into a end_point dict.
        end_points = dict(tf.get_collection(end_points_collection))
        if spatial_squeeze:
          net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
          end_points[sc.name + '/fc8'] = net
        return net, end_points
function_tokens: def overfeat ( inputs , num_classes = 1000 , dropout_keep_prob = 0.5 , is_training = True , spatial_squeeze = True , scope = 'overfeat' ) : with tf . variable_op_scope ( [ inputs ] , scope , 'overfeat' ) as sc : end_points_collection = sc . name + '_end_points' # Collect outputs for conv2d, fully_connected and max_pool2d with slim . arg_scope ( [ slim . conv2d , slim . fully_connected , slim . max_pool2d ] , outputs_collections = end_points_collection ) : net = slim . conv2d ( inputs , 64 , [ 11 , 11 ] , 4 , padding = 'VALID' , scope = 'conv1' ) net = slim . max_pool2d ( net , [ 2 , 2 ] , scope = 'pool1' ) net = slim . conv2d ( net , 256 , [ 5 , 5 ] , padding = 'VALID' , scope = 'conv2' ) net = slim . max_pool2d ( net , [ 2 , 2 ] , scope = 'pool2' ) net = slim . conv2d ( net , 512 , [ 3 , 3 ] , scope = 'conv3' ) net = slim . conv2d ( net , 1024 , [ 3 , 3 ] , scope = 'conv4' ) net = slim . conv2d ( net , 1024 , [ 3 , 3 ] , scope = 'conv5' ) net = slim . max_pool2d ( net , [ 2 , 2 ] , scope = 'pool5' ) with slim . arg_scope ( [ slim . conv2d ] , weights_initializer = trunc_normal ( 0.005 ) , biases_initializer = tf . constant_initializer ( 0.1 ) ) : # Use conv2d instead of fully_connected layers. net = slim . conv2d ( net , 3072 , [ 6 , 6 ] , padding = 'VALID' , scope = 'fc6' ) net = slim . dropout ( net , dropout_keep_prob , is_training = is_training , scope = 'dropout6' ) net = slim . conv2d ( net , 4096 , [ 1 , 1 ] , scope = 'fc7' ) net = slim . dropout ( net , dropout_keep_prob , is_training = is_training , scope = 'dropout7' ) net = slim . conv2d ( net , num_classes , [ 1 , 1 ] , activation_fn = None , normalizer_fn = None , biases_initializer = tf . zeros_initializer , scope = 'fc8' ) # Convert end_points_collection into a end_point dict. end_points = dict ( tf . get_collection ( end_points_collection ) ) if spatial_squeeze : net = tf . squeeze ( net , [ 1 , 2 ] , name = 'fc8/squeezed' ) end_points [ sc . name + '/fc8' ] = net return net , end_points