generating predictions on new data you can verify that the predict method of the model instance returns probability distribution over all topics let' generate topic predictions for all of the test data listing generat ing predict ions for new dat predictions model predict(x_testeach entry in predictions is vector of length predictions[ shape ( ,the coefficients in this vector sum to np sum(predictions[ ] the largest entry is the predicted class--the class with the highest probabilitynp argmax(predictions[ ] different way to handle the labels and the loss we mentioned earlier that another way to encode the labels would be to cast them as an integer tensorlike thisy_train np array(train_labelsy_test np array(test_labelsthe only thing this approach would change is the choice of the loss function the loss function used in listing categorical_crossentropyexpects the labels to follow categorical encoding with integer labelsyou should use sparse_categorical_ crossentropymodel compile(optimizer='rmsprop'loss='sparse_categorical_crossentropy'metrics=['acc']this new loss function is still mathematically the same as categorical_crossentropyit just has different interface the importance of having sufficiently large intermediate layers we mentioned earlier that because the final outputs are -dimensionalyou should avoid intermediate layers with many fewer than hidden units now let' see what happens when you introduce an information bottleneck by having intermediate layers that are significantly less than -dimensionalfor example -dimensional licensed to