human
Solve the following python programming problem given the following code:
# Input function:
def generate_input_fn(dir, batch_size, queue_capacity):
  """Return _input_fn for use with TF Experiment.
  
  Will be called in the Experiment section below (see _experiment_fn).
  
  Args:
    dir: directory we're taking our files from, code is written to collect all files in this dir.
    batch_size: number of rows ingested in each training iteration.
    queue_capacity: number of images the TF queue can store.
    
  Returns:
    _input_fn: a function that returns a batch of images and labels.
  """

  file_pattern = os.path.join(dir, '*')  # We're pulling in all files in the directory.

  def _input_fn():
    """A function that returns a batch of images and labels.

    Args:
      None

    Returns:
      image_batch: 4-d tensor collection of images.
      label_batch: 1-d tensor of corresponding labels.
    """

    height, width, channels = [pixel_dim[0], pixel_dim[1], 3]  # [height, width, 3] because there are 3 channels per image.
    filenames_tensor = tf.train.match_filenames_once(file_pattern)  # Collect the filenames
    # Queue that periodically reads in images from disk:
    # When ready to run iteration, TF will take batch_size number of images out of filename_queue.
    filename_queue = tf.train.string_input_producer(
      filenames_tensor,
      shuffle=False)  # Do not shuffle order of the images ingested.
    # Convert filenames from queue into contents (png images pulled into memory):
    reader = tf.WholeFileReader()
    filename, contents = reader.read(filename_queue)
    # Decodes contents pulled in into 3-d tensor per image:
    image = tf.image.decode_png(contents, channels=channels)
    # If dimensions mismatch, pad with zeros (black pixels) or crop to make it fit:
    image = tf.image.resize_image_with_crop_or_pad(image, height, width)
    # Parse out label from filename:
    label = tf.string_to_number(tf.string_split([tf.string_split([filename], '_').values[-1]], '.').values[0])
    # All your filenames should be in this format number_number_label.extension...
Given the above code, generate some markdown instructions for it.
assistant
#Here is the Python program you requested.

Step 5 - Get tooling for training convolutional neural networks
Here is where we enable training convolutional neural networks on data inputs like ours.  We'll build it using a TensorFlow estimator. TensorFlow (TF) is designed for scale, which means it doesn't pull all our data into memory all at once, but instead it's all about lazy execution.  We'll write functions which it will run when it's efficient to do so.  TF will pull in batches of our image data and run the functions we wrote.  
In order to make this work, we need to write code for the following:

Input function: generate_input_fn()
Neural network architecture: cnn()
Model function: generate_model_fn()
Estimator: tf.estimator.Estimator()
Experiment: generate_experiment_fn()
Prediction generator: cat_finder()

Input function
The input function tells TensorFlow what format of feature and label data to expect.  We'll set ours up to pull in all images in a directory we point it at.  It expects images with filenames in the following format: number_number_label.extension, so if your file naming scheme is different, please edit the input function.