conv_seq2seq
conv_seq2seq copied to clipboard
got two questions about the conv_decoder_fairseq.py
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, :]
@chenjw87 I got the same question, so did you solve the problem, would you like to share it with me?
@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.