def evaluate_model(model, test_images, test_labels, train_images, train_labels):
    """
    Compiles, fits and trains the network
    :param model: keras model
    :param test_images: list of test images
    :param test_labels: list of test labels
    :param train_images: list of train images
    :param train_labels: list of train labels
    :return: tuple(float,float) loss,accuracy
    """
    model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
    model.fit(train_images, train_labels, epochs=8)
    return model.evaluate(test_images, test_labels)