I’m currently training a seq2seq encoder-decoder network powered by LSTM in TensorFlow 2.x. The main problem right now is the loss approaches to NaN and the prediction returned are all NaN as well. I understand the possibility of exploding/vanishing gradients and have deployed several ways to try and combat it (ex: adding min-max layers, adding ..
I have 544 independent time series with the shape (101,2). I want to train an LSTM model to predict next 5 time steps based on past 3 time steps. I split the data so I have the following: input_shape = (544,94,3,2) output_shape = (544,94,5,2) So, my question is, how do I feed this to my ..
I have CSV data with shapes (6042, 6) like this and call it using DataFrame: I want to use it for input on LSTM. From what I read, LSTM requires data in the form of a 3d array [samples, time steps, features]. Because the DataFrame doesn’t have a reshape attribute, I changed it to a ..
Does Python Keras or TensorFlow LSTMs have an Outputted AI Model File so you do not have to re-train the model every time you run the program? Can you just import this AI Model File that will set the relevant variables within the model so you do not need to rerun .csv training files through ..
I am building an Encoder-Decoder for ASR to sentences. For this I have the X and y data which I split. Here is what y looks like: y[0:3] >> array([[ 1, 13, 14, 15, 5, 16, 17, 2, 0, 0, 0, 0, 0], [ 1, 18, 6, 19, 2, 0, 0, 0, 0, 0, 0, ..
I am trying to use multiple LSTM models like Vanilla, Stacked, Bi-directional on my data, but finding the best hyperparameters is very costly. With TPU use on Colab Pro, my program is crashing after running for over 10 hours I tried multiple times. Here is my code: epochs = [10, 25, 50] activations = [‘tanh’, ..
I am doing demand forecasting. I have a set of transactions that can be grouped by feature1, feature2 and month. I want to use the time series data (demand per month) as an input to the LSTM (rnn_in) and the features (feature1, feature2) as an initial state of the LSTM. I do not comprehend how ..
I have data with 561 features and 6 labels (1-6). my train data has shape (7352,562) and my test data has shape (2947,562) like this: then I access it using dataframe and split it into data+features and labels path_data_train= r’/content/drive/MyDrive/train_data.xlsx’ df_train = pd.read_excel(path_data_train) path_data_test= r’/content/drive/MyDrive/test_data.xlsx’ df_test = pd.read_excel(path_data_test) trainX = df_train.iloc[:, 0:-1] trainy = df_train[‘label’] ..
I run an example with the LSTM model with Keras. Data. x_train = Train[:,0:-1] y_train = Train[:,-1] x_test = Test[:,0:-1] y_test = Test[:,-1] x_train = np.reshape(x_train,(x_train.shape,x_train.shape,1)) y_train = np.reshape(y_train,(y_train.shape,1)) x_test = np.reshape(x_test,(x_test.shape,x_test.shape,1)) y_test = np.reshape(y_test,(y_test.shape,1)) Check dimensions of training and testing set. size before appling reshape: (2900, 11) (2900,) (730, 11) (730,) size after appling ..
I have a question that I would like to ask please. I was wondering if there is a way to customize LSTM objective function. for example my goal is to maximize some function and I want LSTM to find the best combination of maximizing that function. Is there a way to do that? Source: Python ..