51498b09368a61bfb06849693688df6eb54d4787,python/eight_mile/tf/embeddings.py,PositionalLookupTableEmbeddings,encode,#PositionalLookupTableEmbeddings#Any#,494

Before Change



    def encode(self, x=None):
        x = super(PositionalLookupTableEmbeddings, self).encode(x) * math.sqrt(self.dsz)
        B, T, C = get_shape_as_list(x)
        signal = get_timing_signal_1d(T, C, min_timescale=1.0, max_timescale=self.max_timescale, start_index=0)
        return x + signal

After Change


    def encode(self, x):
        x = super().encode(x) * tf.constant(self.scale)
        T = tf.shape(x)[1]
        pos = self.positional(T)
        return self.dropout(x + pos, training=TRAIN_FLAG())


class LearnedPositionalLookupTableEmbeddings(LearnedPositionalMixin, LookupTableEmbeddings):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: dpressel/mead-baseline
Commit Name: 51498b09368a61bfb06849693688df6eb54d4787
Time: 2019-11-14
Author: blester125@gmail.com
File Name: python/eight_mile/tf/embeddings.py
Class Name: PositionalLookupTableEmbeddings
Method Name: encode


Project Name: dpressel/mead-baseline
Commit Name: 51498b09368a61bfb06849693688df6eb54d4787
Time: 2019-11-14
Author: blester125@gmail.com
File Name: python/eight_mile/tf/embeddings.py
Class Name: PositionalCharConvEmbeddings
Method Name: encode


Project Name: dpressel/mead-baseline
Commit Name: 51498b09368a61bfb06849693688df6eb54d4787
Time: 2019-11-14
Author: blester125@gmail.com
File Name: python/eight_mile/pytorch/embeddings.py
Class Name: PositionalCharConvEmbeddings
Method Name: forward


Project Name: dpressel/mead-baseline
Commit Name: 51498b09368a61bfb06849693688df6eb54d4787
Time: 2019-11-14
Author: blester125@gmail.com
File Name: python/eight_mile/pytorch/embeddings.py
Class Name: PositionalLookupTableEmbeddings
Method Name: forward