Questions tagged [seq2seq]

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

318 questions
1
vote
1 answer

How to save a seq2seq model in TensorFlow 2.x?

I'm following the "Neural machine translation with attention" tutorial from TensorFlow docs, but can't figure out how to save the model as a SavedModel file. As seen in the docs, I can save a checkpoint fairly easily, but afaik that's not very…
Josh Nies
  • 43
  • 2
  • 5
1
vote
0 answers

Does using FP16 help accelerate generation? (HuggingFace BART)

I follow the guide below to use FP16 in PyTorch. https://pytorch.org/blog/accelerating-training-on-nvidia-gpus-with-pytorch-automatic-mixed-precision/ Basically, I'm using BART in HuggingFace for generation During the training phase, I'm able to…
Allan-J
  • 336
  • 4
  • 11
1
vote
1 answer

Tensorflow & Keras: LSTM performs bad on seq2seq problem with clear solution

I am learning about tensorflow, and seq2seq problems for machine translation. For this I gave me the following task: I created an Excel, containing random dates in different types, for example: 05.09.2192 martes, 07 de mayo de 2329 Friday, 30…
MichaelJanz
  • 1,775
  • 2
  • 8
  • 23
1
vote
0 answers

seq2seq model transformer model - what's the best way to batchify my inputs?

I'm trying to build a character-level model that matches diacritics for Hebrew characters (each character is decorated with a diacritic). Note that the correct diacritic is dependent on the word, the context and the part-of-speech (not trivial). I…
ihadanny
  • 4,377
  • 7
  • 45
  • 76
1
vote
1 answer

Apply an Encoder-Decoder (Seq2Seq) inference model with Attention

Hello a StackOverflow community! I'm trying to create an inference model for a seq2seq (Encoded-Decoded) model with Attention. It's a definition of the inference model. model = compile_model(tf.keras.models.load_model(constant.MODEL_PATH,…
1
vote
1 answer

pytorch backward error, one of variables for gradient computation modified by an inplace operation

I'm new to pytorch, i've been trying to implement a text summarization network. When i call loss.backward() an error appears. RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation:…
Xue Tintin
  • 11
  • 3
1
vote
4 answers

"ValueError: The name "input_2" is used 2 times in the model. All layer names should be unique." Error in keras with seq2seq model

I am writing a chatbot in python with the help of the Keras library and the Seq2Seq model. I train the model first and then save that into a .h5 file and load from that file to use the trained model. However, when I try loading my model from my .h5…
1
vote
0 answers

ChatBot in TensorFlow: TypeError

I'm trying to train a seq2seq model using a miniconda3 environment to create a chatbot. Below is the code I'm using to train it but I keep getting a TypeError when I get to this line of code: training_predictions,test_predictions =…
baldwin
  • 45
  • 6
1
vote
2 answers

TypeError: __init__() got multiple values for argument 'axes'

I want to use attention mechanism with the code bellow : attention = Dot([decoder_outputs, encoder_outputs], axes=[2, 1]) attention = Activation('softmax')(attention) context = Dot([attention, encoder_outputs], axes=[2,1]) decoder_combined_context…
Youness Saadna
  • 792
  • 2
  • 8
  • 25
1
vote
1 answer

How do I predict on more than one batch from a Tensorflow Dataset, using .predict_on_batch?

As the question says, I can only predict from my model with model.predict_on_batch(). Keras tries to concatenate everything together if I use model.predict() and that doesn't work. For my application (a sequence to sequence model) it is faster to do…
grofte
  • 1,839
  • 1
  • 16
  • 15
1
vote
1 answer

DeprecationWarning: Call to deprecated `__getitem__`

I've been trying to solve this error for some days now and I just can't manage to find the cause, I tried changing the cod from embedding_matrix[ i ] = model[vocab[i]] to embedding_matrix[ i ] = model.wv[vocab[i]] in which case I don't get the…
1
vote
0 answers

Tensorflow image captioning / seq2seq decoder as model

I am using a model for sequence prediction starting from a latent representation of an encoded input, which forms the initial state of the decoder. It could be a feature vector from an image (for captioning) or the result of a seq2seq encoder. My…
meow
  • 925
  • 7
  • 22
1
vote
0 answers

Using BERT embeddings for Seq2Seq model building

Earlier I've used Glove embedding to build the seq2seq model for text summarization, Now I want to change the Glove with BERT to see the performance of the model. For this, I used the bert-as-service feature from…
1
vote
0 answers

Is it possible to compute the SHAPley values for a sequence to sequence regressor?

I am trying to understand the contribution of different time series to a multi-step ahead neural network forecasting model. The shape of the input vector is (n_samples, n_timestamps_input, n_features) and the shape of the prediction is (n_samples,…
1
vote
0 answers

keras load model and test the model seq2seq

i have trained the machine translation build in keras with deep learning and i saved the whole mode as model.h5 model.save('model.h5') and now i want load the model and test it example takes the input from the user and then translate it it is…
Black Snow
  • 247
  • 2
  • 14