Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

GPU running out of memory for ConvLSTM model in Pytorch

I'm trying to replicate the bidirectional convolutional LSTM proposed in Xiong et al. 2017 to predict crowd count density maps, but I'm running into memory issues during the training. This is what I'...
yuki's user avatar
  • 11
0 votes
0 answers
17 views

Adding sliding window dimension to data causes error: "Expected 3D or 4D (batch mode) tensor ..."

I wrote a pytorch data loader which used to return data of shape (4,1,192,320) representing the 4 samples of single channel image, each of size ...
Mahesha999's user avatar
0 votes
0 answers
40 views

PyTorch input shape for text classification using LSTM

I have three sentiment classes: POSITIVE, NEGATIVE, and NEUTRAL, along with a dataset consisting of 3000 sentences and their corresponding sentiment labels (POSITIVE, NEGATIVE, or NEUTRAL). Each ...
PatelisGM's user avatar
0 votes
2 answers
650 views

How to add multiple embeddings (layers) to LSTM layer

The similar question was asked before here https://stackoverflow.com/questions/52627739/how-to-merge-numerical-and-embedding-sequential-models-to-treat-categories-in-rn/52629902#...
Любовь Пономарева's user avatar
1 vote
1 answer
3k views

Is sequence length and hidden size is the same in Transformer

I'm confused about sequence length and hidden size if they are the same in Transformer. I think they are different but not sure. ...
user836026's user avatar
1 vote
0 answers
152 views

Backward propagation slower as epochs increase in pytorch

I'm trying to replicate TasNet paper using Pytorch Lightning, but the training time increases as the epochs increase (the first epoch takes 20 seconds, the fifth 2:30 minutes). I've used PyTorch ...
programming-duck's user avatar
0 votes
1 answer
589 views

PyTorch mat1 and mat2 shapes cannot be multiplied (100x200 and 100x9922)

I am trying to make a BiLSTM language model and am having some issues. Model ...
Collander's user avatar
1 vote
1 answer
539 views

pytorchs LSTMs use of 'bias' and 'weight' strings

Hi I am new to RNN and have come across this the following implementation of Pytorchs LSTM, but I cant understand how (or why) the 'bias' and ...
Piskator's user avatar
  • 135
1 vote
1 answer
176 views

In LSTM why h_t output twice?

According the LSTM design: The hidden state (ht) is output twice (1 and 2 in the picture). If they are the same, why we need them twice ? Is there a different use for each one of them ? According to ...
user3668129's user avatar
2 votes
1 answer
3k views

What is the purpose of Sequence Length parameter in RNN (specifically on PyTorch)?

I am trying to understand RNN. I got a good sense of how it works on theory. But then on PyTorch you have two extra dimensions to your input data: batch size (number of batches) and sequence length. ...
Alp Evr's user avatar
  • 23
1 vote
0 answers
753 views

LSTM Text Generation with Pytorch

I am currently trying quote generation (character level) with LSTMs using Pytorch. I am currently facing some issues understanding exactly how the hidden state is implemented in Pytorch. Some details: ...
Apocalyptic Warrior 's user avatar
0 votes
1 answer
908 views

Which output of a BiLSTM layer should be used for classification

I am trying to implement a BiLSTM layer for a text classification problem and using PyTorch for this. ...
Saikat Bhattacharya's user avatar
1 vote
0 answers
147 views

Which One is the Best Way to Create Training Sequences for LSTM-based Class Prediction on Time-series Data?

Let's say I have time-series data in the following way. I need to create training sequences of a fixed length as an input to my LSTM model on PyTorch. ...
bbasaran's user avatar
  • 171
0 votes
1 answer
347 views

How to pass a sequence of 4 images into LSTM and CNN-LSTM

I got an assignment and stuck with it while going down the rabbit hole of learning PyTorch, LSTM, and CNN. Provided the well-known MNIST library I take combinations of 4 numbers and per combination, ...
Sal_H's user avatar
  • 33
2 votes
0 answers
87 views

Time series forecasting. How use future values

I have a time series dataset containing hourly data from a few year, like below. Let's assume that I want to make prediction for the next 3 hours (2021-01-01 19:00, 2021-01-01 20:00, 2021-01-01 21:00)....
Lazer's user avatar
  • 21
0 votes
1 answer
745 views

Help improving time series prediction with LSTM on PyTorch

So, I am trying to use a LSTM model to forecast temperature data on PyTorch. I am relatively new to both PyTorch and the use of recurrent networks so I took a model I found on the internet to start. ...
Ícaro Lorran's user avatar
1 vote
2 answers
2k views

PyTorch: Predicting future values with LSTM

I'm currently working on building an LSTM model to forecast time-series data using PyTorch. I used lag features to pass the previous n steps as inputs to train the network. I split the data into three ...
bkaankuguoglu's user avatar
0 votes
0 answers
31 views

Batching data for LSTMs vs fully connected models

I've implemented an LSTM auto-encoder. It trained well, and does what I want it to so far. But, I think I've misunderstood something fundamental about lstms. In a simple dense network whose input ...
rocksNwaves's user avatar
1 vote
1 answer
858 views

PyTorch: LSTM for time-series failing to learn

I'm currently working on building an LSTM network to forecast time-series data using PyTorch. I tried to share all the code pieces that I thought would be helpful, but please feel free to let me know ...
bkaankuguoglu's user avatar
1 vote
1 answer
206 views

Pytorch Luong global attention: what is the shape of the alignment vector supposed to be?

I am looking at the Luong paper on Attention models and global attention. I understand how the alignment vector is computed from a dot product of the encoder hidden state and the decoder hidden state. ...
krishnab's user avatar
  • 173
1 vote
1 answer
1k views

Pytorch LSTM not training

So I am currently trying to implement an LSTM on Pytorch, but for some reason the loss is not decreasing. Here is my network: ...
user avatar
1 vote
1 answer
495 views

LSTM model prediction scaling with loaded model

I am deploying a LSTM pytorch model for production and I have issue with scaling the LSTM output correctly. While the model was tested the output was scaled with label data: ...
Heikura's user avatar
  • 111
0 votes
1 answer
81 views

LSTM / GRU weights during test time

I am working on a historic time series dataset and using RNN, LSTM, GRU models, and I didn't find an answer if in test time, the h (or h, c) weights should be zeors for each batch? If the weights ...
Yuval Asher's user avatar
1 vote
0 answers
30 views

Learning the distribution of a continuous variable using LSTM

I am trying to implement the following paper : https://arxiv.org/pdf/2006.10701.pdf. In order, to estimate the priors of the hidden states which have continuous values, the authors use a LSTM. I have ...
Oussa's user avatar
  • 11
1 vote
0 answers
62 views

Text generation - Input text (one sentence or many sentences)

I am currently working on a project: I want to generate text with a LSTM using Pytorch. My model is working but I have a question about the methodology: I'm using the BPTTIterator and something seems ...
vinniboi13's user avatar
-1 votes
1 answer
204 views

Bidirectional vs. Traditional LSTM [closed]

I'm working on image captioning problem, where I need to have an encoder for image and decoder for caption generation. Regarding the decoder, I've found a reference that uses Pytorch LSTM where ...
Mohammed Deifallah's user avatar
2 votes
1 answer
267 views

Predicting sequence element based on the previous M and the following N elements

I have an array of sequences of equal length, each sequence contains 300 numbers (M=300). Each element in a sequence is a number from 1 to 9: ...
stv's user avatar
  • 85
0 votes
1 answer
176 views

Considering the output of a BLSTM in pytorch, what's the order of the elements?

I am currently using pytorch to implement a BLSTM-based neural network. I understand that the output of the BLSTM is two times the hidden size. However, I am currently unable to find out whether this ...
MoRoBe's user avatar
  • 13
0 votes
1 answer
1k views

LSTM Multi-class classification for large number of classes

I want to build a model that classifies 473 classes -product categories-, but I'm facing a problem with loss not decreasing. Data I have almost 3,000 data points for each class -473 classes- (data ...
Khaled's user avatar
  • 103
1 vote
1 answer
5k views

How to calculate perplexity in PyTorch?

I am wondering the calculation of perplexity of a language model which is based on ...
Faruk's user avatar
  • 155
1 vote
0 answers
384 views

Pytorch lstm model very high loss in eval mode against train mode

I am using a Siamese network with a 2-layer lstm encoder and dropout=0.5 to classify string similarity. For each batch, I am randomly generating similar and ...
Ramki's user avatar
  • 11
3 votes
0 answers
310 views

Why embedding or rnn/lstm can not handle variable length sequence?

Pytorch embedding or lstm (I don't know about other dnn libraries) can not handle variable-length sequence by default. I am seeing various hacks to handle variable length. But my question is, why this ...
sovon's user avatar
  • 521
2 votes
0 answers
47 views

hidden state of each sequence of mini-batch

I am new to Pytorch and trying to implement a lstm character level seq2seq model. What I am trying to do is: Each sequence is a list of the characters of a particular word and several words will ...
sovon's user avatar
  • 521
1 vote
0 answers
159 views

What is the correct formatting of the input tensor for multi-variate LSTM on Pytorch?

I am working on a LSTM to predict a financial time series using 10 other financial time series. The 10 financial time series form my training dataset. Several examples I have seen for univariate ...
Capeboom's user avatar
  • 161
2 votes
0 answers
1k views

LSTM not converging

I am sorry if this questions is basic but I am quite new to NN in general. I am trying to build an LSTM to predict certain properties of a light curve (the output is 0 or 1). I build it in pytorch. ...
Bill's user avatar
  • 21
1 vote
0 answers
313 views

LSTM Produces Random Predictions

I have trained an LSTM in PyTorch on financial data where a series of 14 values predicts the 15th. I split the data into Train, Test, and Validation sets. I trained the model until the loss ...
Skiddles's user avatar
  • 998
2 votes
2 answers
3k views

Dropout Decreases Test and Train Accuracy in one layer LSTM in Pytorch

I have a one layer lstm with pytorch on Mnist data. I know that for one layer lstm dropout option for lstm in pytorch does not operate. So, I have added a drop out at the beginning of second layer ...
Hadi Gharibi's user avatar