Fashion MNIST 2.0
By now, you are already familiar with this dataset, as we used it in Chapter 5, Image Classification with Neural Networks, and Chapter 6, Improving the Model. Now, let's see how CNNs compare to the simple neural networks we have worked with so far. We will continue in the same spirit as before. We start by importing the required libraries:
- We will import the requisite libraries for preprocessing, modeling, and visualizing our ML model using TensorFlow:
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
- Next, we will load the Fashion MNIST dataset from TensorFlow Datasets using the
load_data()
function. This function returns our training and testing data consisting of NumPy arrays. The training data consists ofx_train
andy_train
, and the test data is made up ofx_test
andy_test
:(x_train,y_train),(x_test,y_test) = tf.keras.datasets.fashion_mnist.load_data()
- We can confirm the data size by using the
len
function on our training...