original_docstring: 
      Train neural network and print out the loss during training.
      :param sess: TF Session
      :param epochs: Number of epochs
      :param batch_size: Batch size
      :param get_batches_fn: Function to get batches of training data.  Call using get_batches_fn(batch_size)
      :param train_op: TF Operation to train the neural network
      :param cross_entropy_loss: TF Tensor for the amount of loss
      :param input_image: TF Placeholder for input images
      :param correct_label: TF Placeholder for label images
      :param keep_prob: TF Placeholder for dropout keep probability
      :param learning_rate: TF Placeholder for learning rate
      
docstring: Train neural network and print out the loss during training.
docstring_tokens: Train neural network and print out the loss during training .
code: def train_nn(sess, epochs, batch_size, get_batches_fn, train_op, cross_entropy_loss, input_image,
               correct_label, keep_prob, learning_rate):
      """
      Train neural network and print out the loss during training.
      :param sess: TF Session
      :param epochs: Number of epochs
      :param batch_size: Batch size
      :param get_batches_fn: Function to get batches of training data.  Call using get_batches_fn(batch_size)
      :param train_op: TF Operation to train the neural network
      :param cross_entropy_loss: TF Tensor for the amount of loss
      :param input_image: TF Placeholder for input images
      :param correct_label: TF Placeholder for label images
      :param keep_prob: TF Placeholder for dropout keep probability
      :param learning_rate: TF Placeholder for learning rate
      """
      # TODO: Implement function
      for epoch in range(epochs):
          print("Epoch: {}".format(epoch+1))
          batch = 1
          for image, label in get_batches_fn(batch_size):
              # Train
              start = time.time()
              _, loss = sess.run([train_op, cross_entropy_loss], feed_dict={
                                 input_image: image, correct_label: label, keep_prob: 0.55, learning_rate: 1e-4})
              end = time.time()
              print('Batch number: {}'.format(batch))
              print('Training loss: {:.3f}'.format(loss))
              print('Time: {}'.format(end-start))
  
              batch += 1
      pass
code_tokens: def train_nn ( sess , epochs , batch_size , get_batches_fn , train_op , cross_entropy_loss , input_image , correct_label , keep_prob , learning_rate ) : for epoch in range ( epochs ) : print ( "Epoch: {}" . format ( epoch + 1 ) ) batch = 1 for image , label in get_batches_fn ( batch_size ) : start = time . time ( ) _ , loss = sess . run ( [ train_op , cross_entropy_loss ] , feed_dict = { input_image : image , correct_label : label , keep_prob : 0.55 , learning_rate : 1e-4 } ) end = time . time ( ) print ( 'Batch number: {}' . format ( batch ) ) print ( 'Training loss: {:.3f}' . format ( loss ) ) print ( 'Time: {}' . format ( end - start ) ) batch += 1 pass
short_docstring: Train neural network and print out the loss during training.
short_docstring_tokens: Train neural network and print out the loss during training .
comment: """
      Train neural network and print out the loss during training.
      :param sess: TF Session
      :param epochs: Number of epochs
      :param batch_size: Batch size
      :param get_batches_fn: Function to get batches of training data.  Call using get_batches_fn(batch_size)
      :param train_op: TF Operation to train the neural network
      :param cross_entropy_loss: TF Tensor for the amount of loss
      :param input_image: TF Placeholder for input images
      :param correct_label: TF Placeholder for label images
      :param keep_prob: TF Placeholder for dropout keep probability
      :param learning_rate: TF Placeholder for learning rate
      """$SEP$# TODO: Implement function$SEP$# Train