122f4ae6f400f0c43f3fc6a85481264809e678f5,GPflow/kernels.py,PeriodicKernel,K,#PeriodicKernel#Any#Any#,249

Before Change


            
        // Introduce dummy dimension so we can use broadcasting
        f= tf.reshape(X, tf.pack([tf.shape(X)[0], 1, tf.shape(X)[1]]) )
        f2= tf.reshape(X2, tf.pack([1, tf.shape(X2)[0], tf.shape(X2)[1]]) )
        r = np.pi * (f-f2) / self.period
        
        dist = tf.exp(-0.5*tf.reduce_sum(tf.square(tf.sin(r)/self.lengthscales),tf.rank(r)-1))

After Change



        // Introduce dummy dimension so we can use broadcasting
        f = tf.expand_dims(X, 1)  // now N x 1 x D
        f2 = tf.expand_dims(X2, 0)  // now 1 x M x D

        r = np.pi * (f-f2) / self.period
        r = tf.reduce_sum(tf.square(tf.sin(r)/self.lengthscales), 2)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: GPflow/GPflow
Commit Name: 122f4ae6f400f0c43f3fc6a85481264809e678f5
Time: 2016-05-27
Author: james.hensman@gmail.com
File Name: GPflow/kernels.py
Class Name: PeriodicKernel
Method Name: K


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 9f7738878e833a435fa4ca0a47db9515100cfaaf
Time: 2018-10-15
Author: guillaume.klein@systrangroup.com
File Name: opennmt/layers/transformer.py
Class Name:
Method Name: build_sequence_mask


Project Name: GPflow/GPflow
Commit Name: 122f4ae6f400f0c43f3fc6a85481264809e678f5
Time: 2016-05-27
Author: james.hensman@gmail.com
File Name: GPflow/kernels.py
Class Name: PeriodicKernel
Method Name: K


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 9f7738878e833a435fa4ca0a47db9515100cfaaf
Time: 2018-10-15
Author: guillaume.klein@systrangroup.com
File Name: opennmt/layers/transformer.py
Class Name:
Method Name: build_future_mask