Does the final layer of a model in tensorflow need to match the number of labels? I am building the following CNN for practice using the following image dataset: https://www.kaggle.com/xhlulu/recursion-2019-load-resize-and-save-images/data
It has 1108 labels.  Does the output of my CNN need to match that number?
model = keras.Sequential([
    keras.Input(shape=(224,224,3)),
    layers.Conv2D(filters=224, kernel_size=5,
                  input_shape=(batch_size, 224, 224, 3),
                  data_format= 'channels_last',
                  activation = 'relu', 
                  strides=(2,2), 
                  padding= 'same'),
    layers.MaxPooling2D(pool_size=(8,8)),
    layers.Conv2D(filters=224, 
                  kernel_size=3,
                  activation = 'relu', 
                  strides=(1,1), 
                  padding= 'same'),
    layers.MaxPooling2D(pool_size=(2,2)),
    layers.Flatten(),
    layers.Dense(64, activation = 'relu'),
    layers.Dense(1, activation = 'sigmoid')
])


Conceptually, the typical multi-class classification model uses a softmax activation in the final layer to give a probability vector (all elements are non-negative and sum to 1), and has $K$ elements for each of the $K$ classes.
As a practical matter, it is preferrable to make predictions on the logit scale and combine the softmax and categorical cross-entropy loss into a single operation (exponentiation and logarithms cancel out). Combining these operations does not round-trip the exponential and logarithm functions, and preserves numerical precision. This is important, because it tends to avoid roundoff error which can result in $\log(0)$.
