def train(model, train_generator, val_generator, save_to, epochs=3):
    """
    Train specified model with specified train and validation datasets.
    :param model: keras model object
    :param train_generator: AbstractDatasetGenerator object (train data)
    :param val_generator: AbstractDatasetGenerator object (validation data)
    :param save_to: path to save trained model
    :param epochs: number of epochs to run
    :return: keras.train() result (history object)
    """
    # LANGUAGE_TO_CLASS, MAP_LANGUAGE_TO_FILES, MAP_CLASS_TO_FILES_LIST = init_class_to_files_list(
    #     '/home/kolegor/Study/Master/data/use2big_wav_big_splitted_5')
    #
    # train_gen_data, test_gen_data, val_gen_data = init_train_val_test_folders_iter(MAP_CLASS_TO_FILES_LIST)

    train_data_steps = train_generator.estimate_batches()
    val_data_steps = val_generator.estimate_batches()

    history = model.fit_generator(
        train_generator,  # DatasetGenerator(train_gen_data, batch_size),
        validation_data=val_generator,  # DatasetGenerator(val_gen_data, batch_size),
        validation_steps=val_data_steps,
        steps_per_epoch=train_data_steps,
        epochs=epochs
    )

    model.save(save_to)
    return history