A channel is a feature plane in a structured neural-network tensor. A grayscale Fashion-MNIST image becomes a 28×28×1 tensor because its original 2D array lacks an explicit channel dimension. section 7.1
In a convolutional network, Conv2D layers transform channel counts through learned filters: the demonstrated model expands 1 input channel to 64, then reduces representations to 32 and 16 channels. MaxPooling layers summarize the resulting features. section 7.1
Listing 7.1 EDL_7_1_Keras_CNN.ipynb: Loading data
dataset = datasets.fashion_mnist #1
(x_train, y_train), (x_test, y_test) = #1
dataset.load_data() #1
x_train = x_train.reshape(x_train.shape[0], 28, 28, 1) #2
.astype("float32") / 255.0 #2
x_test = x_test.reshape(x_test.shape[0], 28, 28, 1) #2
.astype("float32") / 255.0 #2
x_train = x_train[:1000] #3
y_train= y_train[:1000] #3
x_test = x_test[:100] #3
y_test= y_test[:100] #3
Inspect the reshape operations that add the single channel dimension to the Fashion-MNIST tensors. section 7.1
Listing 7.2 EDL_7_1_Keras_CNN.ipynb: Building CNN layers
model = models.Sequential() model.add(layers.Conv2D(64, (3, 3), activation='relu', padding="same", input_shape=(28, 28, 1))) #1 model.add(layers.MaxPooling2D((2, 2), padding="same")) #2 model.add(layers.Conv2D(32, (3, 3), activation='relu', [padding="same")) #3 model.add(layers.MaxPooling2D((2, 2))) #4 model.add(layers.Conv2D(16, (3, 3), activation='relu')) #5 model.add(layers.MaxPooling2D((2, 2))) #6 model.summary()
Inspect the Keras Conv2D configuration that changes channel counts across successive layers. section 7.1






