3da641f3841d0cbb55543e691d4a2be1ca4102b7,deepctr/layers.py,CrossNet,call,#CrossNet#Any#,232

Before Change



        x = inputs
        dim = x.get_shape()[-1]
        x_0 = K.reshape(x,[-1,dim, 1])
        x_l = x_0
        for i in range(self.layer_num):
            dot_ = tf.matmul(x_0, tf.transpose(x_l, [0, 2, 1]))  // K.dot(x_0,K.transpose(x_l))
            dot_ = K.dot(dot_, self.kernels[i])

After Change


        if K.ndim(inputs) !=2 :
            raise ValueError("Unexpected inputs dimensions %d, expect to be 2 dimensions"% (K.ndim(inputs)))

        x_0 = tf.expand_dims(inputs,axis=2)
        x_l = x_0
        for i in range(self.layer_num):
            xl_w = tf.tensordot(tf.transpose(x_l,[0,2,1]),self.kernels[i],axes=(-1,0))
            dot_ = tf.matmul(x_0,xl_w)
            x_l = dot_ + x_l + self.bias[i]
        x_l = tf.squeeze(x_l,axis=2)
        return x_l
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: shenweichen/DeepCTR
Commit Name: 3da641f3841d0cbb55543e691d4a2be1ca4102b7
Time: 2018-11-28
Author: last.fantasy@qq.com
File Name: deepctr/layers.py
Class Name: CrossNet
Method Name: call


Project Name: deepmind/sonnet
Commit Name: 869b558268f198de90822e4ea17182dc74b78213
Time: 2017-11-09
Author: noreply@google.com
File Name: sonnet/python/modules/conv.py
Class Name: Conv2D
Method Name: _build


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: keras-team/keras
Commit Name: 8f2b5f0458cce4e5588238b86e3e2738952ea849
Time: 2015-11-19
Author: francois.chollet@gmail.com
File Name: keras/layers/convolutional.py
Class Name: MaxPooling1D
Method Name: get_output