c8523b2dc735a1b82ca6170e6ca349defe9f77fc,txtgen/modules/decoders/transformer_decoders.py,TransformerDecoder,_build,#TransformerDecoder#Any#Any#,65
Before Change
tgt_embedding = inputs
num_units = tf.shape(tgt_embedding).as_list()[2]
if self.scale:
tgt_embedding = tgt_embedding * tf.sqrt(num_units)
if self._hparams.sinusoid:
position_dec_embeds = layers.sinusoid_positional_encoding(tgt_embedding,
scope = "dec_pe")
dec_input = tf.layers.dropout(tgt_embedding + position_dec_embeds,
After Change
self.logits = tf.layers.dense(attended_dec, self._vocab_size)
self.preds = tf.to_int32(tf.arg_max(self.logits, dimension=-1))
//[batch, seq_len]
print("self.preds:{}".format(self.preds.shape))
return self.logits, self.preds
@property
def output_size(self):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: asyml/texar
Commit Name: c8523b2dc735a1b82ca6170e6ca349defe9f77fc
Time: 2017-11-17
Author: shore@pku.edu.cn
File Name: txtgen/modules/decoders/transformer_decoders.py
Class Name: TransformerDecoder
Method Name: _build
Project Name: geomstats/geomstats
Commit Name: 984791ffafd92b472624bc24056ddc7edd4012aa
Time: 2018-04-12
Author: ninamio78@gmail.com
File Name: geomstats/hyperbolic_space.py
Class Name: HyperbolicMetric
Method Name: exp_basis
Project Name: geomstats/geomstats
Commit Name: 88f01a67f6cc3c16bf20b7c892fcca9b9ab33937
Time: 2018-04-12
Author: ninamio78@gmail.com
File Name: geomstats/hyperbolic_space.py
Class Name: HyperbolicMetric
Method Name: exp_basis