def train_model(model, data, epochs=1000):
    """Training Routine

    :param model: Model
    :type model: tf.keras.Model object
    :param data: Data
    :type data: tuple
    :param epochs: Number of Epochs, defaults to 1000
    :type epochs: int, optional
    :return: History of training
    :rtype: dict
    """

    # Data
    x_train = data['x_train']
    y_train = data['y_train']
    x_test = data['x_test']
    y_test = data['y_test']

    # Compile
    model.compile(
        loss='mse',
        optimizer='adam',
        metrics=['mae'],
    )

    # Train
    history = model.fit(
        x=x_train,
        y=y_train,
        batch_size=20,
        epochs=epochs,
        validation_data=(x_test, y_test),
        # callbacks=[TqdmCallback()],
        verbose=0,
    )

    return history