Lab 1. Paper rock scissors

In the last layer we specify 3 neurons to do the classification, 1 neuron per class.

tf.keras.layers.Dense(3, activation=‘softmax’)

output: [ 0.80 0.20 0.0 ]

paper probability = 0.80
rock probability = 0.20
scissors probability = 0.00

One neuron correspond to class paper, one for rock and one for scissors. The Output is an array of 3 elements.

How do we know the order of the classes in the output?
where and when did we set that order?
If I create a new NN, how can I know the order of the classes in the output?

thank you :slight_smile:

print(train_generator.class_indices)
{'paper': 0, 'rock': 1, 'scissors': 2}

The directory iterator picks the classes in alphabetical order. But, it’s good to rely on the property shown above.

2 Likes

thank you Balaji ! exactly what I was looking for. :slight_smile: