to make the network ready for trainingwe need to pick three more thingsas part of the compilation stepa loss function--how the network will be able to measure its performance on the training dataand thus how it will be able to steer itself in the right direction an optimizer--the mechanism through which the network will update itself based on the data it sees and its loss function metrics to monitor during training and testing--herewe'll only care about accuracy (the fraction of the images that were correctly classifiedthe exact purpose of the loss function and the optimizer will be made clear throughout the next two listing the compilation st ep network compile(optimizer='rmsprop'loss='categorical_crossentropy'metrics=['accuracy']before trainingwe'll preprocess the data by reshaping it into the shape the network expects and scaling it so that all values are in the [ interval previouslyour training imagesfor instancewere stored in an array of shape ( of type uint with values in the [ interval we transform it into float array of shape ( with values between and listing preparing he image data train_images train_images reshape(( )train_images train_images astype('float ' test_images test_images reshape(( )test_images test_images astype('float ' we also need to categorically encode the labelsa step that' explained in listing preparing he labels from keras utils import to_categorical train_labels to_categorical(train_labelstest_labels to_categorical(test_labelswe're now ready to train the networkwhich in keras is done via call to the network' fit method--we fit the model to its training datanetwork fit(train_imagestrain_labelsepochs= batch_size= epoch / / [============================== loss acc epoch / / [========================eta loss acc licensed to