Questions tagged [lstm]

Long short-term memory. A neural network (NN) architecture that contains recurrent NN blocks that can remember a value for an arbitrary length of time. A very popular building block for deep NN.

Long short-term memory neural networks (LSTMs) are a subset of recurrent neural networks. They can take time-series data and make predictions using knowledge of how the system is evolving.

A major benefit to LSTMs is their ability to store and utilize long-term information, not just what they are provided at a particular instance. For more information on LSTMs check out these links from colah's blog post and MachineLearningMastery.

6289 questions
2
votes
1 answer

How does tensorflow's tf.contrib.training.batch_sequences_with_states API work?

I am dealing with long sequential data which has to be passed to an RNN. To do truncated BPTT and batching, seems like there are two options: Create a batch by combining respective segments from different sequences. Preserve final state of each…
2
votes
1 answer

How to use reset_states(states) function in Keras?

I'm trying to set the LSTM internal state before training each batch. I'm sharing my test code and findings, hoping to find an answer and help others that are addressing similar problems. In particular, for each data I have a feature X (which…
user2614596
  • 630
  • 2
  • 11
  • 30
2
votes
1 answer

Keras set output of intermediate layer to 0 or 1 based on threshold

I have a model that has "classification" and "regression" like parts. I merge them using multiplication layer. Before performing multiplication I want to set outputs of classification part to 0 or 1 based on threshold. I tried to use Lambda layer…
Asterisk
  • 3,534
  • 2
  • 34
  • 53
2
votes
0 answers

How to train a hierarchical model in two parts

This is a follow up to the following question: Confused about how to implement time-distributed LSTM + LSTM The current draft structure that is working well: The basic idea is that there is a TimeDistributed deep LSTM input layer that works on each…
Adam Jones
  • 775
  • 6
  • 23
2
votes
1 answer

Understand Keras LSTM weights

I can understand how to multiply Dense layer weights in order to get predicted output, but how can I interpret matrices from LSTM model? Here are some toy examples (don't mind fitting, it's just about matrix multiplication) Dense example: from…
Alex Ozerov
  • 988
  • 8
  • 21
2
votes
0 answers

How to perform decoding of one to many LSTM architecture

How to decode one to many LSTM architecture (https://discuss.pytorch.org/t/example-of-many-to-one-lstm/1728) in tensorflow? Can we use tf.contrib.seq2seq.dynamic_decode of tensorflow? For training I used tf.nn.dynamic_rnn cells = [] for i,…
RamRasia
  • 51
  • 1
  • 7
2
votes
1 answer

[keras]Many to many probability prediction using LSTM

My problem is to predict the error probability of a time series data. In the data, we have (n_samples, timesteps, features), where timesteps are the maximum length of the time series. The training y_train has one_hot labels of each time point being…
2
votes
0 answers

TensorFlow RNN: Set trainable flag

I'm building a model that requires the network to be copied before training so there is an "old" and "new" network. Training is only performed on the new network, and the old network is static. The magnitude of the training update is clipped…
Anjum Sayed
  • 872
  • 9
  • 20
2
votes
2 answers

weights does not exist, or was not created with tf.get_variable()

I spend days trying to figure out what is going on and I am still getting this error. here is the error I get ValueError: Variable rnn/multi_rnn_cell/cell_1/basic_lstm_cell/weights does not exist, or was not created with tf.get_variable(). Did…
Zardaloop
  • 1,594
  • 5
  • 22
  • 43
2
votes
1 answer

Output_shape of lstm model

I have a test data of 1025643 entries and 72 features/attributes. I have trained an lstm with input data trainX with shape (245, 30, 72) and trainY with shape (245, ). Also note that I have specified look-back to be 30 steps back hence (245, 30, 72)…
Fawad Khalil
  • 357
  • 3
  • 20
2
votes
1 answer

LSTM Timeseries Classification

I am new to neural networks and LSTMs, hence need some help here. I have 100 files of varying time lengths and each file has 13 features each. Each file represents an output class. Now, I want to have a LSTM network which can classify these…
2
votes
2 answers

Error when checking target: expected time_distributed_5 to have 3 dimensions, but got array with shape (14724, 1)

Trying to build a single output regression model, but there seems to be problem in the last layer inputs = Input(shape=(48, 1)) lstm = CuDNNLSTM(256,return_sequences=True)(inputs) lstm = Dropout(dropouts[0])(lstm) #aux_input auxiliary_inputs =…
mojo1643
  • 65
  • 7
2
votes
0 answers

Is order of data frames important in RNN / LSTM

I learned from examples on the internet that when processing time series with RNN or LSTM, the time series should be divided into overlapping time windows like that: [1,2,3,4,5,6] => [[1,2,3],[2,3,4][3,4,5][4,5,6]] This was quite a surprise for me…
2
votes
1 answer

how does masking work in a recurrent model in keras?

I found a nicely trained LSTM-based network. The network allows for masking. for l in range(len(model.layers)): d=model.layers[l].__dict__ print(d['supports_masking']) print(d['name']) is True for me for all the 'name' beside the…
00__00__00
  • 4,834
  • 9
  • 41
  • 89
2
votes
1 answer

Tensorflow doesn't want to use GPU

I want to train "standford chatbot" from here https://github.com/chiphuyen/stanford-tensorflow-tutorials/tree/master/assignments/chatbot on GPU, but it doesn't use my GPU, but all need libraries (CuNN, CUDA, tensorflow-gpu etc.) are installed I…