parameters: (is_training, weight_decay, feature, label, data_format,
                batch_norm_decay, batch_norm_epsilon)
return_statement: return tower_loss, list(zip(tower_grad, model_params)), tower_pred
docstring: Build computation tower.
  
      Args:
          is_training: true if is training graph.
          weight_decay: weight regularization strength, a float.
          feature: a Tensor.
          label: a Tensor.
          data_format: channels_last (NHWC) or channels_first (NCHW).
          batch_norm_decay: decay for batch normalization, a float.
          batch_norm_epsilon: epsilon for batch normalization, a float.
  
      Returns:
          A tuple with the loss for the tower, the gradients and parameters, and
          predictions.
docstring_summary: Build computation tower.
docstring_tokens: Build computation tower .
function: def _tower_fn(is_training, weight_decay, feature, label, data_format,
                batch_norm_decay, batch_norm_epsilon):
      """Build computation tower.
  
      Args:
          is_training: true if is training graph.
          weight_decay: weight regularization strength, a float.
          feature: a Tensor.
          label: a Tensor.
          data_format: channels_last (NHWC) or channels_first (NCHW).
          batch_norm_decay: decay for batch normalization, a float.
          batch_norm_epsilon: epsilon for batch normalization, a float.
  
      Returns:
          A tuple with the loss for the tower, the gradients and parameters, and
          predictions.
  
      """
      model = mlp_model.MlpModel(
          batch_norm_decay=batch_norm_decay,
          batch_norm_epsilon=batch_norm_epsilon,
          is_training=is_training,
          data_format=data_format)
      logits = model.forward_pass(feature, input_data_format='channels_last')
      tower_pred = {
          'classes': tf.argmax(input=logits, axis=1),
          'probabilities': tf.nn.softmax(logits)
      }
  
      tower_loss = tf.losses.sparse_softmax_cross_entropy(
          logits=logits, labels=label)
      tower_loss = tf.reduce_mean(tower_loss)
  
      model_params = tf.trainable_variables()
      tower_loss += weight_decay * tf.add_n(
          [tf.nn.l2_loss(v) for v in model_params])
  
      tower_grad = tf.gradients(tower_loss, model_params)
  
      return tower_loss, list(zip(tower_grad, model_params)), tower_pred
function_tokens: def _tower_fn ( is_training , weight_decay , feature , label , data_format , batch_norm_decay , batch_norm_epsilon ) : model = mlp_model . MlpModel ( batch_norm_decay = batch_norm_decay , batch_norm_epsilon = batch_norm_epsilon , is_training = is_training , data_format = data_format ) logits = model . forward_pass ( feature , input_data_format = 'channels_last' ) tower_pred = { 'classes' : tf . argmax ( input = logits , axis = 1 ) , 'probabilities' : tf . nn . softmax ( logits ) } tower_loss = tf . losses . sparse_softmax_cross_entropy ( logits = logits , labels = label ) tower_loss = tf . reduce_mean ( tower_loss ) model_params = tf . trainable_variables ( ) tower_loss += weight_decay * tf . add_n ( [ tf . nn . l2_loss ( v ) for v in model_params ] ) tower_grad = tf . gradients ( tower_loss , model_params ) return tower_loss , list ( zip ( tower_grad , model_params ) ) , tower_pred