Questions tagged [encoder-decoder]

184 questions
49
votes
1 answer

Base64 String to byte[] in java

I am trying to convert base64 String to byte array but it is throwing following error java.lang.IllegalArgumentException: Illegal base64 character 3a I have tried following options userimage is base64 string byte[] img1 =…
Ninad Kulkarni
  • 503
  • 1
  • 5
  • 10
14
votes
2 answers

Multilayer Seq2Seq model with LSTM in Keras

I was making a seq2seq model in keras. I had built single layer encoder and decoder and they were working fine. But now I want to extend it to multi layer encoder and decoder. I am building it using Keras Functional API. Training:- Code for…
SAGAR
  • 151
  • 1
  • 7
10
votes
1 answer

How do I train a encoder-decoder model for a translation task using hugging face transformers?

I would like to train a encoder decoder model as configured below for a translation task. Could someone guide me as to how I can set-up a training pipeline for such a model? Any links or code snippets would be appreciated to understand. from…
7
votes
3 answers

YUV420 to BGR image from pixel pointers

I am capturing raw output from a decoder which is YUV420. I have got three pointers: Y(1920*1080), U(960*540) and V(960*540) separately. I want to save the image as JPEG using OpenCV. I tried using cvtcolor of opencv cv::Mat…
6
votes
1 answer

How to add Attention layer between two LSTM layers in Keras

I am trying to add an Attention layer between the encoder LSTM(many to many) and the decoder LSTM(many to one). But my code seem making the attention layer for only one Decoder LSTM input. How can I apply the Attention layer to all the inputs of the…
alexis
  • 61
  • 3
5
votes
1 answer

How can I embed Ffmpeg extension into Exoplayer under windows?

For some reasons I have to work under windows 10 OS with Android-Studio as IDE. My problem is that, exoplayer uses software and hardware decoders of Android-TV device to decode video streams. Apparently, most of the Android-TV devices have no…
pk_mdi
  • 71
  • 6
5
votes
1 answer

How to define ConvLSTM encoder_decoder in Keras?

I have seen examples of building an encoder-decoder network using LSTM in Keras but I want to have a ConvLSTM encoder-decoder and since the ConvLSTM2D does not accept any 'initial_state' argument so I can pass the initial state of the encoder to the…
5
votes
2 answers

PyTorch: DecoderRNN: RuntimeError: input must have 3 dimensions, got 2

I am building a DecoderRNN using PyTorch (This is an image-caption decoder): class DecoderRNN(nn.Module): def __init__(self, embed_size, hidden_size, vocab_size): super(DecoderRNN, self).__init__() self.hidden_size =…
Edamame
  • 23,718
  • 73
  • 186
  • 320
5
votes
1 answer

Passing initial_state to Bidirectional RNN layer in Keras

I'm trying to implement encoder-decoder type network in Keras, with Bidirectional GRUs. The following code seems to be working src_input = Input(shape=(5,)) ref_input = Input(shape=(5,)) src_embedding = Embedding(output_dim=300,…
nisargjhaveri
  • 1,469
  • 11
  • 21
4
votes
1 answer

Using the encoder part only from T5 model

I want to build a classification model that needs only the encoder part of language models. I have tried Bert, Roberta, xlnet, and so far I have been successful. I now want to test the encoder part only from T5, so far, I found encT5…
4
votes
1 answer

Why is my attention model worse than non-attention model

My task was to convert english sentence to German sentence. I first did this with normal encoder-decoder network, on which I got fairly good results. Then, I tried to solve the same task with the same exact model as before, but with Bahdanau…
user14349917
4
votes
0 answers

Need help in understanding Encoder-Decoder code in Tensorflow

I am reading "Hands-On Machine Learning with Scikit-Learn and TensorFlow" by Aurelion Geron. I am currently reading the Encoder-Decoder section of the book and I stumbled upon some code that I don't fully understand, and I find the explanations from…
user010517720
  • 2,127
  • 2
  • 7
  • 15
4
votes
1 answer

Model inputs must come from `tf.keras.Input` ..., they cannot be the output of a previous non-Input layer

I'm using Python 3.7.7. and Tensorflow 2.1.0. I have a pre-trained U-Net network, and I want to get its encoder and its decoder. In the following picture: You can see a convolutional encoder-decoder architecture. I want to get the encoder part,…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
4
votes
2 answers

LSTM Encoder-Decoder Inference Model

Many tutorials for seq2seq encoder-decoder architecture based on LSTM, (for example English-French translation), define the model as follow: encoder_inputs = Input(shape=(None,)) en_x= Embedding(num_encoder_tokens,…
userInThisWorld
  • 1,361
  • 4
  • 18
  • 35
4
votes
1 answer

How to get max resolution of MediaCodec before configuring

My app create several instance of MediaCodec which work parallel as video/audio decoders and encoders. I know that video codec has limiting buffer space and this limit depends on device. For example on tab Samsung SM-P600 I can create four…
Oleg Sokolov
  • 1,134
  • 1
  • 12
  • 19
1
2 3
12 13