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

Before Change


        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))

        return self.variance * dist
    
    

After Change


            X2 = X

        // 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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

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: geomstats/geomstats
Commit Name: 506b234094009d55d326f1ce957f53f15d4b65ee
Time: 2018-02-26
Author: ninamio78@gmail.com
File Name: geomstats/spd_matrices_space.py
Class Name:
Method Name: group_exp


Project Name: geomstats/geomstats
Commit Name: a9b58d07768ec06f8718ec2777f2b0293359f5b4
Time: 2020-04-09
Author: hadizaatiti@gmail.com
File Name: geomstats/learning/frechet_mean.py
Class Name:
Method Name: _ball_gradient_descent