Building an image classifier using a single layer neural network
Let's see how to create a single layer neural network using TensorFlow
and use it to build an image classifier. We will be using MNIST image dataset to build our system. It is dataset containing handwritten images of digits. Our goal is to build a classifier that can correctly identify the digit in each image.
Create a new python and import the following packages:
import argparse import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data
Define a function to parse the input arguments:
def build_arg_parser(): parser = argparse.ArgumentParser(description='Build a classifier using \MNIST data') parser.add_argument('--input-dir', dest='input_dir', type=str, default='./mnist_data', help='Directory for storing data') ...