def lenet(images, num_classes=10, is_training=False, dropout_keep_prob=0.5, prediction_fn=slim.softmax, scope='LeNet'):
 end_points = {}
 with tf.variable_scope(scope, 'LeNet', [images, num_classes]):
  net = slim.conv2d(images, 32, [5, 5], scope='conv1')
  net = slim.max_pool2d(net, [2, 2], 2, scope='pool1')
  net = slim.conv2d(net, 64, [5, 5], scope='conv2')
  net = slim.max_pool2d(net, [2, 2], 2, scope='pool2')
  net = slim.flatten(net)
  end_points['Flatten'] = net
  net = slim.fully_connected(net, 1024, scope='fc3')
  net = slim.dropout(net, dropout_keep_prob, is_training=is_training, scope='dropout3')
  logits = slim.fully_connected(net, num_classes, activation_fn=None, scope='fc4')
 end_points['Logits'] = logits
 end_points['Predictions'] = prediction_fn(logits, scope='Predictions')
 return (logits, end_points)

def lenet ( images , num_classes = 10 , is_training = False , dropout_keep_prob = 0.5 , prediction_fn = slim . softmax , scope = 'LeNet' ) : end_points = { } with tf . variable_scope ( scope , 'LeNet' , [ images , num_classes ] ) : net = slim . conv2d ( images , 32 , [ 5 , 5 ] , scope = 'conv1' ) net = slim . max_pool2d ( net , [ 2 , 2 ] , 2 , scope = 'pool1' ) net = slim . conv2d ( net , 64 , [ 5 , 5 ] , scope = 'conv2' ) net = slim . max_pool2d ( net , [ 2 , 2 ] , 2 , scope = 'pool2' ) net = slim . flatten ( net ) end_points [ 'Flatten' ] = net net = slim . fully_connected ( net , 1024 , scope = 'fc3' ) net = slim . dropout ( net , dropout_keep_prob , is_training = is_training , scope = 'dropout3' ) logits = slim . fully_connected ( net , num_classes , activation_fn = None , scope = 'fc4' ) end_points [ 'Logits' ] = logits end_points [ 'Predictions' ] = prediction_fn ( logits , scope = 'Predictions' ) return ( logits , end_points )
creates a variant of the lenet model .