lstm.py
def train(self, x_train: np.ndarray, y_train: np.ndarray, batch_size:int, n_epochs:int) -> dict:
        """ Train the model on the data that is passed as parameter.
            Return a dictionary with the values of the metrics.
        """

        history = self.model.fit(x_train, y_train, batch_size=batch_size, epochs=n_epochs, validation_split=0.1)
        loss_list = history.history["loss"]
        accuracy_list = history.history["accuracy"]
        metrics_dict = {}
        metrics_dict["loss"] = loss_list
        metrics_dict["accuracy"] = accuracy_list

        return metrics_dict
 Train the model on the data that is passed as parameter.
            Return a dictionary with the values of the metrics.
        
Train the model on the data that is passed as parameter.
Return a dictionary with the values of the metrics.
Train the model on the data that is passed as parameter . Return a dictionary with the values of the metrics .
def train(self, x_train: np.ndarray, y_train: np.ndarray, batch_size:int, n_epochs:int) -> dict:
        history = self.model.fit(x_train, y_train, batch_size=batch_size, epochs=n_epochs, validation_split=0.1)
        loss_list = history.history["loss"]
        accuracy_list = history.history["accuracy"]
        metrics_dict = {}
        metrics_dict["loss"] = loss_list
        metrics_dict["accuracy"] = accuracy_list
        return metrics_dict
def train ( self , x_train : np . ndarray , y_train : np . ndarray , batch_size : int , n_epochs : int ) -> dict : history = self . model . fit ( x_train , y_train , batch_size = batch_size , epochs = n_epochs , validation_split = 0.1 ) loss_list = history . history [ "loss" ] accuracy_list = history . history [ "accuracy" ] metrics_dict = { } metrics_dict [ "loss" ] = loss_list metrics_dict [ "accuracy" ] = accuracy_list return metrics_dict
Train the model on the data that is passed as parameter.
Train the model on the data that is passed as parameter .
""" Train the model on the data that is passed as parameter.
            Return a dictionary with the values of the metrics.
        """
self
x_train
np.ndarray
y_train
np.ndarray
batch_size
int
n_epochs
int