Creating the Model
Now time to create our first neural network model! We will do this by using the Sequential object from keras. A Sequential model simply defines a sequence of layers starting with the input layer and ending with the output layer. Our model will have 3 layers, and input layer of 784 neurons (representing all of the 28x28 pixels in a picture) a hidden layer of an arbitrary 128 neurons and an output layer of 10 neurons representing the probability of the picture being each of the 10 classes.
Training the Model
Now that we have defined the model it is time to compile and train it. Compiling the model is just picking the optimizer, loss function and metrics to keep track of. Training is the process of passing our data to the model.
Testing the Model
Now that the model has been trained it is time to test it for accuracy. We will do this using the following line of code:
In the next tutorial we will use our trained model to make predictions on specific images.