5b6da0cf476a8adf7320766760a0756d53df0e48,opennmt/decoders/self_attention_decoder.py,SelfAttentionDecoder,decode,#SelfAttentionDecoder#Any#Any#Any#Any#Any#Any#Any#Any#,37
Before Change
memory=None,
memory_sequence_length=None,
return_logits=True):
with tf.variable_scope("position_embedding"):
input_dim = inputs.get_shape().as_list()[-1]
position_embedding = create_position_embedding(
input_dim,
128,
sequence_length)
inputs = self.position_encoding_reducer.reduce(inputs, position_embedding)
inputs = tf.layers.dropout(
inputs,
rate=self.dropout,
training=mode == tf.estimator.ModeKeys.TRAIN)
After Change
self.dropout = dropout
self.position_encoder = position_encoder
def decode(self,
inputs,
sequence_length,
vocab_size,
encoder_states=None,
mode=tf.estimator.ModeKeys.TRAIN,
memory=None,
memory_sequence_length=None,
return_logits=True):
if self.position_encoder is not None:
inputs = self.position_encoder(inputs, sequence_length=sequence_length)
inputs = tf.layers.dropout(
inputs,
rate=self.dropout,
training=mode == tf.estimator.ModeKeys.TRAIN)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 17
Instances
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 5b6da0cf476a8adf7320766760a0756d53df0e48
Time: 2017-08-22
Author: guillaume.klein@systrangroup.com
File Name: opennmt/decoders/self_attention_decoder.py
Class Name: SelfAttentionDecoder
Method Name: decode
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 5b6da0cf476a8adf7320766760a0756d53df0e48
Time: 2017-08-22
Author: guillaume.klein@systrangroup.com
File Name: opennmt/encoders/conv_encoder.py
Class Name: ConvEncoder
Method Name: encode
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 5b6da0cf476a8adf7320766760a0756d53df0e48
Time: 2017-08-22
Author: guillaume.klein@systrangroup.com
File Name: opennmt/decoders/self_attention_decoder.py
Class Name: SelfAttentionDecoder
Method Name: decode
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 5b6da0cf476a8adf7320766760a0756d53df0e48
Time: 2017-08-22
Author: guillaume.klein@systrangroup.com
File Name: opennmt/encoders/self_attention_encoder.py
Class Name: SelfAttentionEncoder
Method Name: encode