efe5155ad7184f04510a5cc53b6327993ce77cd4,texar/modules/decoders/transformer_decoders.py,TransformerDecoder,default_hparams,#,83
Before Change
the sentence is completed.
The meaning of other parameters are similar to TransformerEncoder
return {
"sampling_method": "argmax",
"initializer": None,
"multiply_embedding_mode": "sqrt_depth",
"position_embedder_hparams": None,
"share_embed_and_transform": True,
"transform_with_bias": True,
"num_heads":8,
"num_blocks":6,
"maximum_decode_length":10,
"embedding_dropout":0.1,
"attention_dropout":0.1,
"residual_dropout":0.1,
"poswise_feedforward":None,
"num_units":512,
"eos_idx": 2,
"bos_idx": 1,
"beam_width":1,
"alpha":0,
"name":"transformer_decoder",
}
def _prepare_tokens_to_embeds(self, tokens):
a callable function to transform tokens into embeddings.
token_emb = tf.nn.embedding_lookup(self._embedding, tokens)
After Change
the sentence is completed.
The meaning of other parameters are similar to TransformerEncoder
return {
"initializer": None,
"position_embedder_hparams": None,
"share_embed_and_transform": True,
"transform_with_bias": True,
"num_heads":8,
"num_blocks":6,
"maximum_decode_length":256,
"embedding_dropout":0.1,
"attention_dropout":0.1,
"residual_dropout":0.1,
"poswise_feedforward": {
"name":"ffn",
"layers":[
{
"type":"Dense",
"kwargs": {
"name":"conv1",
"units":2048,
"activation":"relu",
"use_bias":True,
}
},
{
"type":"Dropout",
"kwargs": {
"rate": 0.1,
}
},
{
"type":"Dense",
"kwargs": {
"name":"conv2",
"units":512,
"use_bias":True,
}
}
],
},
"dim":512,
"eos_idx": 2,
"bos_idx": 1,
"beam_width":1,
"alpha":0,
"name":"transformer_decoder",
}
def _prepare_tokens_to_embeds(self, tokens):
a callable function to transform tokens into embeddings.
token_emb = tf.nn.embedding_lookup(self._embedding, tokens)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: asyml/texar
Commit Name: efe5155ad7184f04510a5cc53b6327993ce77cd4
Time: 2018-08-22
Author: shore@pku.edu.cn
File Name: texar/modules/decoders/transformer_decoders.py
Class Name: TransformerDecoder
Method Name: default_hparams
Project Name: asyml/texar
Commit Name: e7f5af1e34e07a3e9f3ef886827beac62507d4f9
Time: 2018-08-23
Author: zhitinghu@gmail.com
File Name: texar/modules/encoders/transformer_encoders.py
Class Name: TransformerEncoder
Method Name: default_hparams
Project Name: asyml/texar
Commit Name: efe5155ad7184f04510a5cc53b6327993ce77cd4
Time: 2018-08-22
Author: shore@pku.edu.cn
File Name: texar/modules/decoders/transformer_decoders.py
Class Name: TransformerDecoder
Method Name: default_hparams
Project Name: asyml/texar
Commit Name: e7f5af1e34e07a3e9f3ef886827beac62507d4f9
Time: 2018-08-23
Author: zhitinghu@gmail.com
File Name: texar/modules/decoders/transformer_decoders.py
Class Name: TransformerDecoder
Method Name: default_hparams