seq2seq icon indicating copy to clipboard operation
seq2seq copied to clipboard

Add embedding layer to Seq2Seq model

Open azinnai opened this issue 8 years ago • 2 comments

Hi, I'm trying to add an embedding layer at the begging of the encoder but I cannot figured out an effective way to do this.

Does someone have an idea?

Thanks

azinnai avatar Jul 24 '17 00:07 azinnai

Define the embedding layer yourself and then call the model on it

inp = Input(...)
emb = Embedding(...)(inp)
output = Seq2Seq(...)(emb)
model = Model(inp, output)

fredtcaroli avatar Sep 27 '17 16:09 fredtcaroli

@fredtcaroli if input_Y is shape(batchsize * timestep),output is shape(batchsize * timestep * outputdim),then how to calculate the loss?

zhongluwang avatar Oct 24 '17 12:10 zhongluwang