def train_network(net, epochs, training_data, validation_data, batch_size, callbacks, verbose=1):
    """
    train a network on data for a fixed number of epochs
    parameters:
        net: network to train
        epochs: number of epochs
        training_data: training data under the format of numpy arrays (inputs, labels)
        validation_data: validation data under the format of numpy arrays (inputs, labels)
        batch_size: size of batch for training
        callbacks: callbacks wanted for the training
        verbose: display of training (1:yes, 2: no)
    """

    print('\nStart the training')
    hist = net.fit(training_data[0], training_data[1], epochs=epochs,
                    batch_size=batch_size,
                    verbose=verbose,
                    shuffle=True,
                    validation_data=(validation_data[0], validation_data[1]),
                    validation_steps=int(len(validation_data[0])/batch_size),
                    callbacks=callbacks)

    return hist