Questions tagged [seq2seq]

Seq2Seq is a sequence to sequence learning add-on for the python deep learning library.

318 questions
1
vote
1 answer

FairSeq - sample loss weighting

I'm trying to learn a seq2seq model with fairseq. I want to have different loss weighting for each sample, so there will be examples which the model will try to fit better. What is the correct way to do it? Maybe better libraries for that purpose?
user3209762
  • 113
  • 6
1
vote
1 answer

InvalidArgumentError when training a seq2seq model

I'm trying to use sequence to sequence model on words but during training I keep getting invalid argument error. I don't know what I'm doing wrong here. Please help me out. Here's a sample code to reproduce the error I'm getting. I'm…
user_12
  • 1,778
  • 7
  • 31
  • 72
1
vote
1 answer

How can I do prepare data for a seq2seq model?

I'm building a machine translation (Eng-French) using sequence to sequence lstm model. I've seen the keras seq2seq-lstm example and I couldn't understand how to prepare data from text, this is the for loop used for preparing data. But I couldn't…
user_12
  • 1,778
  • 7
  • 31
  • 72
1
vote
0 answers

Loss is not decreasing in Keras Seq2seq Bidirectional LSTM with Attention

Anybody can see why the loss in this model is not decreasing? I tried to integrate a bidirectional LSTM with the attention model at the end of Andrew Ng's Deep Learning specialization…
1
vote
1 answer

how to import 'tf.contrib.seq2seq.dynamic_decoder' in tensorflow2.0?

I used 'tf.contrib.seq2seq.dynamic_decoder' in tensorflow1.0 and now I want to use it in tensorflow2.0; but I don't know how to import it in tensorflow2.0
vx2008
  • 95
  • 1
  • 1
  • 10
1
vote
0 answers

What to do when GPU memory is fully used

Recently, I have started working with 1 Tesla T4 GPU with 12 vCpu and 60 GB RAM. I am training an Seq2Seq bidirectional LSTM with attention layer and have 38,863,916 training parameters. While training my Seq2Seq model I am getting following errors…
hR 312
  • 824
  • 1
  • 9
  • 22
1
vote
1 answer

In tensorflow is there a way to find out a shape (rank) of elements' outputs while building a graph?

I'm trying to build a graph in tensorflow. But it gives me an error that I have wrong rank of shape. So, I'm trying to locate at which step something went wrong. Is there a chance to find out shapes of elements's outputs while building a graph? For…
Alena
  • 125
  • 2
  • 2
  • 11
1
vote
2 answers

BERT for Text Summarization

I'm trying to build a text summarization model using seq2seq architecture in Keras. I've followed this tutorial https://keras.io/examples/lstm_seq2seq/ and implemented it with Embeddings layer, which works fine. But now I want to use BERT. Can…
1
vote
1 answer

Why do we need padding in seq2seq network

To handle sequences of different, I would like to know. Why do we need padding the sequence the word to the same length? If the answer is "Yes, you need padding.". Can I set the padding in other indexes? For example, if I have an index word like…
Pisit Nakjai
  • 141
  • 1
  • 1
  • 10
1
vote
0 answers

Keras ConvS2S why use len(input_texts) in the prediction?

I'm running the ConvS2S example, the model trains just fine, but the inference code it's not clear enough, why does the prediction arrays have the length of the inputs_texts? My predictions output gibberish, I'm clearly doing something wrong, since…
Pedro Lima
  • 93
  • 2
  • 5
1
vote
1 answer

Looping over pytorch LSTM

I am training a seq2seq model for machine translation in pytorch. I would like to gather the cell state at every time step, while still having the flexibility of multiple layers and bidirectionality, that you can find in the LSTM module of pytorch,…
thaumoctopus
  • 113
  • 1
  • 13
1
vote
1 answer

sequenceInputLayer() Dimensions of arrays being concatenated are not consistent

I try to create an LSTM model. I get following error: Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in source (line 9) sequenceInputLayer(33) What should be the input of sequenceInputLayer and its…
nartin
  • 13
  • 2
1
vote
2 answers

Seq2Seq for string reversal

If I have a string, say "abc" and target of that string in reverse, say "cba". Can a neural network, in particular an encoder-decoder model, learn this mapping? If so, what is the best model to accomplish this. I ask, as this is a structural…
1
vote
1 answer

How to test a model trained using teacher forcing

I used keras to train a seq2seq model (keras.models.Model). The X and y to the model are [X_encoder, X_decoder] and y i.e. a list of encoder and decoder inputs and labels (Note that the decoder input, X_decoder is ‘y’ with one position ahead than…
nightfury
  • 74
  • 1
  • 7
1
vote
1 answer

Output hidden state in OpenNMT-py

I just have a short question regarding the pytorch version of OpenNMT. There does not seem to be an option to return the hidden state of encoder and decoder in the options. Am I missing a flag or is this not an option in OpenNMT-py?
thaumoctopus
  • 113
  • 1
  • 13