Building classification models using MNIST dataset

Let's take a look at the following steps and learn to build a classification model:

  1. We have to import the libraries that we will use in this dataset. Use the following lines of code to import the tensorflow, numpy, and matplotlib libraries:
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt

from tensorflow.contrib.layers import fully_connected

%matplotlib inline
  1. We will import the fully_connected function, which we will be used to build the layers of our network, from tensorflow.contrib.layers