getting started with neural networks relevant to the classification problemthis information can never be recovered by later layerseach layer can potentially become an information bottleneck in the previous exampleyou used -dimensional intermediate layersbut -dimensional space may be too limited to learn to separate different classessuch small layers may act as information bottleneckspermanently dropping relevant information for this reason you'll use larger layers let' go with units listing model definit ion from keras import models from keras import layers model models sequential(model add(layers dense( activation='relu'input_shape=( ,))model add(layers dense( activation='relu')model add(layers dense( activation='softmax')there are two other things you should note about this architectureyou end the network with dense layer of size this means for each input samplethe network will output -dimensional vector each entry in this vector (each dimensionwill encode different output class the last layer uses softmax activation you saw this pattern in the mnist example it means the network will output probability distribution over the different output classes--for every input samplethe network will produce dimensional output vectorwhere output[iis the probability that the sample belongs to class the scores will sum to the best loss function to use in this case is categorical_crossentropy it measures the distance between two probability distributionsherebetween the probability distribution output by the network and the true distribution of the labels by minimizing the distance between these two distributionsyou train the network to output something as close as possible to the true labels listing compiling the model model compile(optimizer='rmsprop'loss='categorical_crossentropy'metrics=['accuracy']validating your approach let' set apart , samples in the training data to use as validation set listing set ing aside validation set x_val x_train[: partial_x_train x_train[ :y_val one_hot_train_labels[: partial_y_train one_hot_train_labels[ :licensed to