listing getting started with neural networks model with an informat ion bot leneck model models sequential(model add(layers dense( activation='relu'input_shape=( ,))model add(layers dense( activation='relu')model add(layers dense( activation='softmax')model compile(optimizer='rmsprop'loss='categorical_crossentropy'metrics=['accuracy']model fit(partial_x_trainpartial_y_trainepochs= batch_size= validation_data=(x_valy_val)the network now peaks at ~ validation accuracyan absolute drop this drop is mostly due to the fact that you're trying to compress lot of information (enough information to recover the separation hyperplanes of classesinto an intermediate space that is too low-dimensional the network is able to cram most of the necessary information into these eight-dimensional representationsbut not all of it further experiments try using larger or smaller layers units unitsand so on you used two hidden layers now try using single hidden layeror three hidden layers wrapping up here' what you should take away from this exampleif you're trying to classify data points among classesyour network should end with dense layer of size in single-labelmulticlass classification problemyour network should end with softmax activation so that it will output probability distribution over the output classes categorical crossentropy is almost always the loss function you should use for such problems it minimizes the distance between the probability distributions output by the network and the true distribution of the targets there are two ways to handle labels in multiclass classificationencoding the labels via categorical encoding (also known as one-hot encodingand using categorical_crossentropy as loss function encoding the labels as integers and using the sparse_categorical_crossentropy loss function if you need to classify data into large number of categoriesyou should avoid creating information bottlenecks in your network due to intermediate layers that are too small licensed to