3. Image Classification with Convolutional Neural Networks (CNNs)
Activity 3.01: Building a Multiclass Classifier Based on the Fashion MNIST Dataset
Solution
- Open a new Jupyter Notebook.
- Import
tensorflow.keras.datasets.fashion_mnist
:from tensorflow.keras.datasets import fashion_mnist
- Load the Fashion MNIST dataset using
fashion_mnist.load_data()
and save the results to(features_train, label_train), (features_test, label_test)
:(features_train, label_train), (features_test, label_test) = \ fashion_mnist.load_data()
- Print the shape of the training set:
features_train.shape
The output will be as follows:
(60000, 28, 28)
The training set is composed of
60000
images of size28
by28
. We will need to reshape it and add the channel dimension. - Print the shape of the testing set:
features_test.shape
The output will be as follows:
(10000, 28, 28)
The testing set is composed of
10000
images of size28
by28
. We will need to reshape it and add the channel dimension
...