Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Filter by
Sorted by
Tagged with
-1 votes
1 answer
35 views

defining the input shape of LSTM in Kears [duplicate]

I'm trying to build LSTM using keras. but it doesn't accept to pass the input shape or any other other parameters in the LSTM layer. This is my code def LSTM(structure): model = Sequential() ...
Med EC's user avatar
  • 19
0 votes
2 answers
417 views

How do I concatenate outputs of two different models if the shapes are completely different?

I am having two pretrained models in pytorch which use different type of input data. Both of them I am using for feature extraction and want to concatenate their outputs at the end and put them into ...
dlus's user avatar
  • 21
0 votes
2 answers
327 views

why is my predicted LSTM model shifted left as well as the accuracy 0

I have seen some other posts with shifted LSTM models being shifted however looking into them I didn't find a solution.Is something wrong with how im slicing the data in the Sequential_Input function? ...
Steven's user avatar
  • 95
0 votes
1 answer
237 views

Error using plot in MATLAB. Invalid data argument

I am using MATLAB 2021a. I have regression problem. I facing error in using buffer. Problem is here actually. Q_signal is 1000x1 double and estimated_Q_signals is 991x1 cell and every cell is 1x10 row ...
Leo23's user avatar
  • 1
1 vote
0 answers
118 views

How to add multiple embeddings (layers) to LSTM layer

The similar question was asked before here How to Merge Numerical and Embedding Sequential Models to treat categories in RNN, but I didn't understand a clear answer. I will use the author’s @GRS ...
Любовь Пономарева's user avatar
0 votes
0 answers
203 views

How to train GNN on huge datasets?

I have a dataset having a shape of (783126,3) where in my dataset there are three columns R1, R2 and Score representing Residue 1, Residue 2 and their Score. I want to train a Graph Neural Network on ...
tanya singhal's user avatar
1 vote
1 answer
102 views

LSTM model has a concerning loss graph and returns a constant value on predictions

My dataset is 597515 rows, 31 columns measuring one variable. So input shape (31,1). import pandas as pd import tensorflow as tf gpu_devices = tf.config.experimental.list_physical_devices("GPU&...
mospira's user avatar
  • 71
0 votes
1 answer
154 views

Input 0 of layer "bidirectional" is incompatible with the layer: expected ndim=3, found ndim=2. shape received: (None, 32)

Here is the snippet of code: vectorizer = TextVectorization(max_tokens=MAX_FEATURES, output_sequence_length=1800, output_mode='int') ...
moosecles's user avatar
1 vote
0 answers
60 views

Low Tensorflow Model Test Accuracy

My model takes binary input which is from binary encoded text (not one-hot encoded). I achieve a binary accuracy of 99.5% and accuracy of 85%. Immediately after training, I achieve a test result of ...
Tunde's user avatar
  • 21
9 votes
5 answers
63k views

No module named 'keras.wrappers'

I have this code on google colab which allows me to optimise an LSTM model using gridsearchCV, but recently an error message has appeared: ModuleNotFoundError: No module named 'keras.wrappers'. is ...
Bouram's user avatar
  • 125
0 votes
0 answers
179 views

ValueError: Exception encountered when calling layer 'reshape' (type Reshape)

I am working on image captioning model using satellite images. I have a .json file through which I am training the model for generating captions. Below is my code- import numpy as np import pandas as ...
Aishwary Shree's user avatar
2 votes
0 answers
75 views

Keras LSTM for continuous output and with EarlyStopping

I wrote an LSTM regression model. It is a model with batch_size=1 and return_sequences = True for the last LSTM layer. I also set validation_data and patience for training. But there seem to be ...
蘇泳誌's user avatar
0 votes
0 answers
94 views

Issues with LSTM-based Time Series Prediction in TensorFlow

I'm trying to predict time-series stock market data using TensorFlow and a Recurrent Neural Network (RNN) with LSTM layers. However, I encountered an input data shape-related error. So, I need ...
Switzerland2020's user avatar
0 votes
0 answers
90 views

Keras error: LSTM.__init__() missing 1 required positional argument: 'units'

The code in TT_RNN is : def __init__(self, tt_input_shape, tt_output_shape, tt_ranks, activation='tanh', recurrent_activation='hard_sigmoid', ...
Rakl's user avatar
  • 1
0 votes
0 answers
155 views

Very low accuracy and high loss with LSTM model

I try to learn the inverse kinematics of a robotic manipulator. To do that I have a simulator with which I acquired data. My dataset is composed of positions in X, Y and Z and actuator variables (6 of ...
Guillaume's user avatar
0 votes
1 answer
719 views

LSTM Time Series forecasting

I've been working on a time series forecasting project using LSTM (Long Short-Term Memory) by following a YouTube tutorial. My dataset consists of NDVI (Normalized Difference Vegetation Index) values ...
FF123456's user avatar
0 votes
0 answers
271 views

Exception encountered when calling layer 'lstm' (type LSTM)

I am trying to build a time series model using LSTM to predict money printing values. Dataset contains monthly money printing records, so have used the sequence_order as 12. Following is the code ...
Udith Kanchana's user avatar
0 votes
1 answer
80 views

My LSTM network doesn't work while doing inference?

I'm trying to built a Conv-LSTM network using PyTorch, model is pretty much like an image caption generator, the model learns to predict words pretty good while training but doesn't predict anything ...
sam's user avatar
  • 7
-2 votes
1 answer
223 views

How can I correct my Time Series LSTM RNN for Binary Classification favoring Class 0?

I am attempting to predict a binary outcome based on 15 continuous sequences (except one which isn't a continuous line, but still a sequence). The dataset contains 933k datapoints for all 15 features ...
Didlex's user avatar
  • 1
0 votes
0 answers
1k views

SHAP DeepExplainer for LSTM time series data

I have a PyTorch LSTM model that takes as input a sequence of 12 time series values, and I also include 3 static features. The output is a sequence of 6 values. I want to use SHAP (SHapley Additive ...
Lydia's user avatar
  • 95
0 votes
2 answers
175 views

LSTNet RuntimeError: Input and parameter tensors are not at the same device

I cloned a github repo which runs a pytorch deep learning module, I customized this part to send the module and the data into GPU. train_dataset = MarketDataset(train_data, history_len=history_len) ...
Amri Rasyidi's user avatar
1 vote
2 answers
6k views

How to perform hyperparameter tuning of LSTM using GridSearchCV?

I am new to deep learning, and I started implementing hyperparameter tuning for LSTM using GridSearchCV. My dataset contains 15551 rows and 21 columns and all values are of type float. Here is my code:...
geethuth's user avatar
  • 113
0 votes
1 answer
196 views

TensorFlow training issue: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)

I'm trying to train an LSTM network with some sequential data with vehicle trajectories, in order to get driver's intention. Here is how I have structures my data: 3 positional features per vehicle, ...
Daniel Navarro's user avatar
1 vote
1 answer
312 views

Using an LSTM model with 2 simultaneous signals to denoise one of the signals

in the medical imaging field, it is common to have two signals, where artifact in one signal bleeds into the other. I'm exploring whether a deep learning model can be used with these signals to ...
seh33's user avatar
  • 182
0 votes
0 answers
33 views

input shape in LSTM-CNN model

How can I give this data to LSTM-CNN model as an input shape? I put my own model code. My data is a satellite image. print(train_x.shape,train_y.shape,test_x.shape,test_y.shape) (9219, 7, 7, 12) (...
Hadi Emami's user avatar
0 votes
2 answers
2k views

SHAP TypeError: 'NoneType' object is not callable

I have a Keras Sequential Model with LSTM and want to analyse it with SHAP. The model runs, but when it comes to the SHAP block it terminates with a type error: class ANN: ...
AndyEverything's user avatar
0 votes
1 answer
71 views

I am trying to run a CNN-LSTM model on a series of images with dimensions (9219, 7, 7, 12) but I get the following error in fit model

model = Sequential() model.add(Conv1D(32, 4, activation='relu', padding='same', input_shape=(train_x.shape[1], train_x.shape[2] * train_x.shape[3]))) model.add(LSTM(32, return_sequences=True)) model....
Hadi Emami's user avatar
0 votes
1 answer
122 views

ValueError: Input 0 of layer "sequential_21" is incompatible with the layer: expected shape=(None, 4, 1), found shape=(None, 7, 7, 12)

I am trying to run a CNN-LSTM model on a series of images with dimensions (9219, 7, 7, 12) but I get the following error : model = Sequential() model.add(Conv1D(32, 4, activation='relu', padding='...
Hadi Emami's user avatar
0 votes
1 answer
329 views

Subclassing keras.model to create a custom autoregressive LSTM model with multi-column input

I'm trying to create a model to forecast energy grid load (net electricity consumed by the grid) based on weather data. In production, we won't have load data to do a standard batch prediction. We're ...
hcollins's user avatar
1 vote
0 answers
141 views

keras seq2seq with GRU instead of LSTM

I am trying to modify the code in https://keras.io/examples/nlp/lstm_seq2seq/ so it uses GRU instead of LSTM. I have managed to get it to train properly and have constructed the encoder-decoder model ...
Duncan Leung's user avatar
1 vote
0 answers
60 views

CNN - RNN model data preparation

I have a dataset that has images for 2000,2010 and 2020. I wrote them in 3 different tfrecord files named combined_2000.tfrecord, combined_2010.tfrecord and combined_2020.tfrecord. I want to use a CNN ...
riskiem's user avatar
  • 307
-2 votes
1 answer
84 views

Issue with LSTM/GRU model acurracy in a protocol prediction implementation

I have a specific model to create.I will go into further details below I have a wireshark cap file,from which i have generated a csv file of 1.4 rows(not the entire cap file but just a sample of it) ...
GENERALE's user avatar
0 votes
2 answers
98 views

Neural Network Architecture for Time Series as Inputs and Outputs with Variable-Length Inputs

I'm currently learning and working on implementing a time series prediction using different packages TensorFlow, Pytorch Neural Network. My goal is to feed a combination of time series data (GM Data) ...
GameCult's user avatar
0 votes
2 answers
596 views

Tesseract Training - Error reading radical code table data/langdata/radical-stroke.txt

I've tried to train Tesseract OCR on specific font, based on polish language model (pol) and my own "ground truth" text - it may be important, that the one generated by me does not contain ...
JP JP's user avatar
  • 1
0 votes
0 answers
52 views

Why LSTM provides different prediction with different batch_size?

I am trying to experiment with a stateless LSTM model on a large dataset and trying to understand the effect of batch_size on the prediction. What I understand is that in model.predict, the batch_size ...
quartzl's user avatar
  • 57
1 vote
0 answers
138 views

Integration of Custom Data Loader with LSTM

I am trying to integrate Custom Data Loader with LSTM num_epochs = 10 for epoch in range(num_epochs): model.train() for batch_x, batch_y in dl: optimizer.zero_grad() outputs = ...
Aneyasha Sarkar's user avatar
0 votes
0 answers
43 views

LSTM network for multiclass classification of timeseries not obtaining good accuracy

I have developed a LSTM network for multi-class classification of timeseries. The timeseries contains 15 columns (features) and 6 classes (labels) [0, 1, 2, 3, 4, 5]. Features include the 3-phase ...
Hossein Ebrahimi's user avatar
-2 votes
1 answer
716 views

Why does my Keras LSTM model not learn patterns on the training set and even gets worse over time?

I am trying to fit a sequential model (LSTM) to my data. For this I am using the Keras library. Simplified, my target is a counter that counts people every day in a location. The features are weather ...
Mrob's user avatar
  • 361
1 vote
1 answer
144 views

Multistep LSTM: Why am i getting the same curve/pattern for each prediction?

I'm new to tensorflow and LSTM models (and coding in general) and would really appreciate some help. I'm getting somewhere, but no matter what i try i seem to always get the same pattern in each ...
The Bunnet Hypothesis's user avatar
0 votes
0 answers
24 views

Stacked Bidirectional LSTM model

The following is the stacked bidirectional LSTM model using TF2. class ForexPredictionModel(tf.keras.Model): def __init__(self, seg_len, **kwargs): super(ForexPredictionModel, self).__init__(**...
batuman's user avatar
  • 7,346
0 votes
0 answers
69 views

Stock Price Prediction: Underperforming LSTM Model Compared to Regular Regression - Seeking Guidance

My dissertation is about Predicting Stock prices. In my case I am using an LSTM model and a various technical indicators. the problem is that now a normal regression model is outperforming my LSTM ...
Samir Benchouk's user avatar
1 vote
1 answer
75 views

Predicting new timeseries based on related timeseries?

Let's say I have multiple timeseries, representing different features, all of length n, and I want to predict a new timeseries which represents another feature, without any past history for that ...
Theo's user avatar
  • 623
1 vote
0 answers
52 views

How to make particular recurrent connection in my Keras/tensorflow neural network model?

I have a LSTM feed-forward neural network as written below. For some reasons, I need to add a backward (recurrent) connection from layer3 to layer1 as well, which results in a loop in my model's ...
Mohammad's user avatar
  • 183
0 votes
0 answers
58 views

How to free memory in lstm

for i in range(0,len(dictStats)): pkb_ips = dictStats[i:i + 1].index.map(str)[0] model_path = file_url + model_url + '/model/' + pkb_ips + '.h5' sc_path = file_url + model_url ...
楊博舜's user avatar
0 votes
0 answers
27 views

LSTM model predicting some column correct while rest giving random number

I am working on a AI model trying to predict inahalable particle number among 7 people. I have 7 columns indicating 7 occupants inhalable particle number over 30 mins. I have multiple cases with ...
kailak's user avatar
  • 1
1 vote
0 answers
66 views

In LSTM, the predicted value is shifted to the right by one compared to the actual value

I am doing a time series forecasting with LSTM. As an input feature, the air pollution level in the last 5 hours and the target is to predict the pollution level in the next hour. It seems to work ...
baran's user avatar
  • 11
0 votes
1 answer
801 views

Predicting future values in a multivariate time forecasting LSTM model that predict future 10 days price on the basis of previous data

I am confused on how to predict future results with a time series multivariate LSTM model. I am trying to build a model for a stock market prediction and I have the following data features Date High ...
Hamzakhan Swati's user avatar
-1 votes
1 answer
503 views

CNN+LSTM for Video Classification

I am attempting to produce a model that will accept multiple video frames as input and provide a label as output (a.k.a. video classification). I have seen code similar to the below in several ...
b19wh33l5's user avatar
0 votes
1 answer
74 views

Tensorflow: Graph of the iterator is different from the graph the dataset was created in

While using the Keras_tuner library I got the error in the title. I have no clue how to fix it and could not find any solutions for some time. I am using Tensorflow BatchDatasets and passing them for ...
Meno's user avatar
  • 1
0 votes
0 answers
226 views

How to use Keras' LSTM to predict at a single timestamp

I currently have a trained LSTM model that I'm using to model a column in Dataframe A. I have all of the training and validation data at my disposal, but I'm writing a method that iterates over ...
user22038162's user avatar

1
3 4
5
6 7
123