conv_seq2seq icon indicating copy to clipboard operation
conv_seq2seq copied to clipboard

got two questions about the conv_decoder_fairseq.py

Open winnechan opened this issue 7 years ago • 2 comments

I have read your code and it's very help! But I have two little questions:

(1) in the function conv_block, why reverse the second axis of the next_layer? next_layer = linear_mapping_weightnorm(next_layer[:,-1:,:], self.params["nout_embed"], var_scope_name="linear_mapping_after_cnn")

(2) in the function _create_position_embedding, why there a 2 offset of the pos_embed, is it for the padding? pe_slice = self.pos_embed[2:maxlen+2, :]

winnechan avatar Dec 15 '17 09:12 winnechan

@chenjw87 I got the same question, so did you solve the problem, would you like to share it with me?

lymrty avatar Mar 14 '18 00:03 lymrty

@chenjw87

I happen to see your questions and I know the answer of the first. It is not reversing the second axis but subindexing/slicing in the second axis. Why slicing like that? Because in inference we only need to generate the last item.

For the second one, I have emailed the author but still not got his response.

eduOS avatar May 02 '18 03:05 eduOS