Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
1 answer
32 views

RNN performing worse than random guessing on large dataset

I have to start off by saying I am 100% a beginner here. I trained a RNN model on a 30 class dataset with over 90000 samples and it achieved less than 2% accuracy. Training the same model on a small ...
adithom's user avatar
  • 31
0 votes
0 answers
27 views

How to combine Embedding layer with 3D input and 2D input in Pytorch

This familiar with my ideas. How to use Embedding() with 3D tensor in Keras? I'm re-implementing some table-to-text papers using RNN-based seq2seq (like this one https://arxiv.org/pdf/1603.07771v3) ...
jupyter's user avatar
  • 101
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
1 answer
1k views

How to Implement padding and masking sequences for RNN

As an exercise, I'm building a network for binary classification of sequences (whether a sequence belongs to type A or type B). The network consists of an RNN with one LSTM layer, and on top of it an ...
kodkod's user avatar
  • 103
1 vote
2 answers
2k views

RNN with PyTorch - I don't understand the initial parameters

I would like to understand the pyTorch RNN module in detail. There I created a very simple and basic example: ...
Thomas K's user avatar
1 vote
0 answers
871 views

Understanding batch size, sequence, sequence length and batch length of a RNN

My Problem I'm struggling with the different definitions of batch size, sequence, sequence length and batch length of a RNN and how to use it in the correct way. First things first - let's clarify the ...
Thomas K's user avatar
0 votes
1 answer
933 views

How to make an RNN model in PyTorch that has a custom hidden layer(s) and that is compatible with PackedSequence

I want to make an RNN that has for example more hidden layers or layer normalization. I know that is it possible to make a custom RNN by subclassing nn.module, but with this approach is it not ...
Philip T 2007's user avatar
0 votes
0 answers
41 views

Input size vs hidden state in RNNs

Im using PyTorch to implement RNNs on univariate time series data. This is the documentation for the RNN class: link I think I'm understanding the math behind an RNN cell. But I have an specific ...
RLC's user avatar
  • 101
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
0 votes
1 answer
139 views

What is the right Pytorch RNN implementation?

I read about RNN in pytorch: RNN — PyTorch documentation. According to the document the RNN run the following function: I looked on another RNN example (from pytorch tutorial): NLP FROM SCRATCH: ...
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
0 votes
0 answers
63 views

Trying to extend this code to include additional feature volume (in addition to adj close) RNN to predict adj close

I read this article on medium https://medium.com/swlh/a-technical-guide-on-rnn-lstm-gru-for-stock-price-prediction-bce2f7f30346 prep ...
thistleknot's user avatar
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
0 votes
1 answer
792 views

How do I disable libtorch warning

Recently I deployed a program using libtorch (PyTorch C++ API). The program run as expected but its gives me a warning. ...
Kiki Rizki Arpiandi's user avatar
1 vote
0 answers
494 views

Replicating RNN within PyTorch

I tried to create a manual RNN and followed the official PyTorch example, which tries to classify a name to a language. I should note that it does indeed work. I'm not using the final logsoftmax, ...
Muppet's user avatar
  • 807
0 votes
1 answer
132 views

Architecture for linear regression with variable input where each input is n-sized one-hot encoded

I am relatively new to deep learning (got some experience with CNNs in PyTorch), and I am not sure how to tackle the following idea. I want to parse a sentence, e.g. I like trees., one-hot encoded the ...
Bram Vanroy's user avatar
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
1 answer
540 views

Query on unstable loss curves for RNN

I’m currently building sequence models for forecasting, and have tried using RNNs, LSTMs, and GRUs. Something unusual I noticed was the highly unstable loss curves, where the loss sometimes goes back ...
Eugene Yan's user avatar
5 votes
1 answer
11k views

How/What to initialize the hidden states in RNN sequence-to-sequence models?

In an RNN sequence-to-sequence model, the encode input hidden states and the output's hidden states needs to be initialized before training. What values should we initialize them with? How should we ...
alvas's user avatar
  • 2,460
13 votes
3 answers
2k views

An Artificial Neural Network (ANN) with an arbitrary number of inputs and outputs

I would like to use ANNs for my problem, but the issue is my inputs and outputs node numbers are not fixed. I did some google searches before asking my question and found that the RNN may help me with ...
Vadim's user avatar
  • 303