@classmethod
def train(cls, model, train_x, train_y, validation_x, validation_y, number_of_classes, input_shape=(300, 1), epochs=10, lr=0.0001, batch_size=4, optimizer=None, loss=None, metrics=None, normalize=False, show_net_info=True):
    '\n        Function used to train the model.\n        :param keras.Sequential model: model to be trained.\n        :param list train_x: data that will be used to train.\n        :param list train_y: the labels related to the data used to train.\n        :param list validation_x: data that will be used to validate the model trained.\n        :param list validation_y: the labels related to the data used to validate the model trained.\n        :param int number_of_classes: number of classes of the problem.\n        :param tuple input_shape: the input shape that the data must have to be used as training data.\n        :param int epochs: total epochs that the model will be trained.\n        :param float lr: learning rate used to train.\n        :param int batch_size: batch size used to train.\n        :param optimizer: which optimizer will be used to train.\n        :param str loss: loss function used during the training.\n        :param list metrics: metrics used to evaluate the trained model.\n        :param bool normalize: if the data should be normalized (True) or not (False).\n        :param bool show_net_info: if the network topology should be showed (True) or not (False).\n        :return keras.Sequential, dict: model trained and the history of the training process.\n        '
    if (optimizer is None):
        optimizer = keras.optimizers.SGD(lr=lr, momentum=0.9, decay=(0.0001 / epochs))
    if (loss is None):
        loss = keras.losses.categorical_crossentropy
    if (metrics is None):
        metrics = ['acc']
    elif (type(metrics) is not list):
        metrics = [metrics]
    model.compile(optimizer=optimizer, loss=loss, metrics=metrics)
    if show_net_info:
        print(model.summary())
    (train_x, train_y) = cls._prepare_data(train_x, input_shape, train_y, number_of_classes, normalize)
    (validation_x, validation_y) = cls._prepare_data(validation_x, input_shape, validation_y, number_of_classes, normalize)
    kback.set_value(model.optimizer.lr, lr)
    train_history = model.fit(x=train_x, y=train_y, validation_data=(validation_x, validation_y), batch_size=batch_size, epochs=epochs)
    return (model, train_history)
Function used to train the model.
:param keras.Sequential model: model to be trained.
:param list train_x: data that will be used to train.
:param list train_y: the labels related to the data used to train.
:param list validation_x: data that will be used to validate the model trained.
:param list validation_y: the labels related to the data used to validate the model trained.
:param int number_of_classes: number of classes of the problem.
:param tuple input_shape: the input shape that the data must have to be used as training data.
:param int epochs: total epochs that the model will be trained.
:param float lr: learning rate used to train.
:param int batch_size: batch size used to train.
:param optimizer: which optimizer will be used to train.
:param str loss: loss function used during the training.
:param list metrics: metrics used to evaluate the trained model.
:param bool normalize: if the data should be normalized (True) or not (False).
:param bool show_net_info: if the network topology should be showed (True) or not (False).
:return keras.Sequential, dict: model trained and the history of the training process.
@classmethod
def train(cls, model, train_x, train_y, validation_x, validation_y, number_of_classes, input_shape=(300, 1), epochs=10, lr=0.0001, batch_size=4, optimizer=None, loss=None, metrics=None, normalize=False, show_net_info=True):
    '\n        Function used to train the model.\n        :param keras.Sequential model: model to be trained.\n        :param list train_x: data that will be used to train.\n        :param list train_y: the labels related to the data used to train.\n        :param list validation_x: data that will be used to validate the model trained.\n        :param list validation_y: the labels related to the data used to validate the model trained.\n        :param int number_of_classes: number of classes of the problem.\n        :param tuple input_shape: the input shape that the data must have to be used as training data.\n        :param int epochs: total epochs that the model will be trained.\n        :param float lr: learning rate used to train.\n        :param int batch_size: batch size used to train.\n        :param optimizer: which optimizer will be used to train.\n        :param str loss: loss function used during the training.\n        :param list metrics: metrics used to evaluate the trained model.\n        :param bool normalize: if the data should be normalized (True) or not (False).\n        :param bool show_net_info: if the network topology should be showed (True) or not (False).\n        :return keras.Sequential, dict: model trained and the history of the training process.\n        '
    if (optimizer is None):
        optimizer = keras.optimizers.SGD(lr=lr, momentum=0.9, decay=(0.0001 / epochs))
    if (loss is None):
        loss = keras.losses.categorical_crossentropy
    if (metrics is None):
        metrics = ['acc']
    elif (type(metrics) is not list):
        metrics = [metrics]
    model.compile(optimizer=optimizer, loss=loss, metrics=metrics)
    if show_net_info:
        print(model.summary())
    (train_x, train_y) = cls._prepare_data(train_x, input_shape, train_y, number_of_classes, normalize)
    (validation_x, validation_y) = cls._prepare_data(validation_x, input_shape, validation_y, number_of_classes, normalize)
    kback.set_value(model.optimizer.lr, lr)
    train_history = model.fit(x=train_x, y=train_y, validation_data=(validation_x, validation_y), batch_size=batch_size, epochs=epochs)
    return (model, train_history)