Closed BellaCoola closed 1 year ago
If you look at the initialization of cnn_model, you can see the final dense layer with a softmax activation function in place. As a result, the output of cnn_model is already a tensor from the softmax function which is the default type of parameter for sparse_categorical_crossentropy(from_logits=False).
Thank you very much :)
Hello, I am looking at "Lab 2, Part 1: MNIST Digit Classification". In section "1.4 Training the model 2.0", there is the following code block:
Shouldn't the
tf.keras.backend.sparse_categorical_crossentropy()
call also setfrom_logits
parameter toTrue
? (By default it isFalse
.) If no, why not?