sequence-to-sequence

Sequence to Sequence - for time series prediction

▼魔方 西西 提交于 2020-05-25 07:53:47
问题 This bounty has ended . Answers to this question are eligible for a +500 reputation bounty. Bounty grace period ends in 8 hours . Roni Gadot wants to draw more attention to this question. I've tried to build a sequence to sequence model to predict a sensor signal over time based on its first few inputs (see figure below) The model works OK, but I want to 'spice things up' and try to add an attention layer between the two LSTM layers. Model code: def train_model(x_train, y_train, n_units=32, n

How to model the data for sequence to sequence prediction with only one feature

左心房为你撑大大i 提交于 2020-02-07 05:22:16
问题 I have 9000 sequences each of length 200, only one feature. #data.shape= (9000,200,1) I want to predict the sequence of length 200 based on input sequence of length 190. X is input sequence of length 190, and Y is output sequence of length 200. X = np.delete(data,slice(50,60),1) # shape of X = (9000,190,1) Y = data.copy() # shape of Y = (9000,200,1) My question is based on the tutorial Encoder-Decoder Model for Sequence-to-Sequence Prediction and on existing stackoverflow question seq2seq

What does the “source hidden state” refer to in the Attention Mechanism?

爱⌒轻易说出口 提交于 2020-01-24 10:29:06
问题 The attention weights are computed as: I want to know what the h_s refers to. In the tensorflow code, the encoder RNN returns a tuple: encoder_outputs, encoder_state = tf.nn.dynamic_rnn(...) As I think, the h_s should be the encoder_state , but the github/nmt gives a different answer? # attention_states: [batch_size, max_time, num_units] attention_states = tf.transpose(encoder_outputs, [1, 0, 2]) # Create an attention mechanism attention_mechanism = tf.contrib.seq2seq.LuongAttention( num

What does the “source hidden state” refer to in the Attention Mechanism?

非 Y 不嫁゛ 提交于 2020-01-24 10:29:05
问题 The attention weights are computed as: I want to know what the h_s refers to. In the tensorflow code, the encoder RNN returns a tuple: encoder_outputs, encoder_state = tf.nn.dynamic_rnn(...) As I think, the h_s should be the encoder_state , but the github/nmt gives a different answer? # attention_states: [batch_size, max_time, num_units] attention_states = tf.transpose(encoder_outputs, [1, 0, 2]) # Create an attention mechanism attention_mechanism = tf.contrib.seq2seq.LuongAttention( num

Multivariate binary sequence prediction with LSTM

放肆的年华 提交于 2019-12-23 21:19:36
问题 I'm working on a sequence forecasting problem and I don't have much experience in this area, so some of the below questions might be naive. FYI: I've created a follow-up question with a focus on CRFs here I have the following problem: I would like to forecast a binary sequence for multiple, non-independent variables. Inputs: I have a dataset with the following variables: Timestamps Groups A and B Binary signal corresponding to each group at a particular timestamp Additionally, suppose the

Variable Input for Sequence to Sequence Autoencoder

六眼飞鱼酱① 提交于 2019-12-11 16:53:53
问题 I implemented a Sequence to Sequence Encoder Decoder but I am having problems with varying my target length in the prediction. It is working for the same length of the training sequence but not if it is different. What do I need to change ? from keras.models import Model from keras.layers import Input, LSTM, Dense import numpy as np num_encoder_tokens = 2 num_decoder_tokens = 2 encoder_seq_length = None decoder_seq_length = None batch_size = 100 epochs = 2000 hidden_units=10 timesteps=10

How to code a sequence to sequence RNN in keras?

爱⌒轻易说出口 提交于 2019-12-10 13:24:52
问题 I am trying to write a sequence to sequence RNN in keras. I coded this program using what I understood from the web. I first tokenized the text then converted the text into sequence and padded to form feature variable X . The target variable Y was obtained first shifting x to left and then padding it. Lastly I fed my feature and target variable to my LSTM model. This is my code I written in keras for that purpose. from keras.preprocessing.text import Tokenizer,base_filter from keras

Multivariate binary sequence prediction with CRF

浪子不回头ぞ 提交于 2019-12-08 20:43:27
问题 this question is an extension of this one which focuses on LSTM as opposed to CRF. Unfortunately, I do not have any experience with CRFs, which is why I'm asking these questions. Problem: I would like to predict a sequence of binary signal for multiple, non-independent groups. My dataset is moderately small (~1000 records per group), so I would like to try a CRF model here. Available data: I have a dataset with the following variables: Timestamps Group Binary signal representing activity

TensorFlow: nr. of epochs vs. nr. of training steps

倾然丶 夕夏残阳落幕 提交于 2019-12-06 13:14:10
问题 I have recently experimented with Google's seq2seq to set up a small NMT-system. I managed to get everything working, but I am still wondering about the exact difference between the number of epochs and the number of training steps of a model. If I am not mistaken, one epoch consists of multiple training steps and has passed once your whole training data has been processed once. I do not understand, however, the difference between the two when I look at the documentation in Google's own

Difference between two Sequence to Sequence Models keras (with and without RepeatVector)

送分小仙女□ 提交于 2019-12-06 09:39:30
问题 I try to understand what the difference between this model describde here, the following one: from keras.layers import Input, LSTM, RepeatVector from keras.models import Model inputs = Input(shape=(timesteps, input_dim)) encoded = LSTM(latent_dim)(inputs) decoded = RepeatVector(timesteps)(encoded) decoded = LSTM(input_dim, return_sequences=True)(decoded) sequence_autoencoder = Model(inputs, decoded) encoder = Model(inputs, encoded) and the sequence to sequence model described here is second