Installing Tensorflow 2.0
Before we can start loading in the data that we will feed our neural network we must install tensorflow 2.0. If you are on windows it is as easy as typing the following (this is the cpu version):
pip install -q tensorflow==2.0.0-alpha0
If you are having any troubles try following the instructions on the tensorflow website.
The last thing to install is MatPlotLib. If you are unfamiliar with matplotlib it is a python module that allows us to visualize and graph data. Install it with the pip command below:
pip install matplotlib
The Importance of Data
Data is by far the most important part of any neural network. Choosing the right data and transforming it into a form that the neural network can use and understand is vital and will affect the networks performance. This is because the data we pass the network is what it will use to modify its weights and biases!
In these first few tutorials we will simply use some built in keras datasets which will make loading data fairly easy. The dataset we will use to start is the Fashion MNIST datset. This dataset contains 60000 images of different clothing/apparel items. The goal of our network will be to look at these images and classify them appropriately To load our first dataset in we will do the following:
Now we will split our data into training and testing data. It is important that we do this so we can test the accuracy of the model on data it has not seen before.
Finally we will define a list of the class names and pre-process images. We do this by dividing each image by 255. Since each image is greyscale we are simply scaling the pixel values down to make computations easier for our model.