6972f0a09dcd30b6eff5057430a612248f417f47,grakel/graph_kernels.py,GraphKernel,calculate_kernel_matrix,#GraphKernel#Any#Any#Any#,431

Before Change


                
            K = np.zeros(shape = (num_of_targets,num_of_graphs))
            if is_symmetric:
                for i in range(0,num_of_targets):
                    for j in range(i,num_of_graphs):
                        K[i,j] = self._pairwise_kernel_executor(kernel, target_graph[i], X_graph[i])
                        if(i!=j):
                            K[j,i] = K[i,j]
            else:
                for i in range(0,num_of_targets):
                    for j in range(0,num_of_graphs):
                        K[i,j] = self._pairwise_kernel_executor(kernel, target_graph[i], X_graph[i])

After Change


            else:
                is_symmetric = False
                num_of_targets = len(target_graph.keys())
                pairs = list(itertools.product(range(0, num_of_targets), range(0, num_of_graphs)))

            K = np.zeros(shape = (num_of_targets,num_of_graphs))
            
            for (i,j) in pairs:
                K[i,j] = self._pairwise_kernel_executor(kernel, target_graph[i], X_graph[j])

            if is_symmetric:
                K = np.triu(K) + np.triu(K, 1).T

            return K     
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: ysig/GraKeL
Commit Name: 6972f0a09dcd30b6eff5057430a612248f417f47
Time: 2018-01-10
Author: y.siglidis@gmail.com
File Name: grakel/graph_kernels.py
Class Name: GraphKernel
Method Name: calculate_kernel_matrix


Project Name: ysig/GraKeL
Commit Name: 6972f0a09dcd30b6eff5057430a612248f417f47
Time: 2018-01-10
Author: y.siglidis@gmail.com
File Name: grakel/graph_kernels.py
Class Name: GraphKernel
Method Name: calculate_kernel_matrix


Project Name: scipy/scipy
Commit Name: 5ce91f1cc0d3dcdb8b53c47990774173b82eff62
Time: 2017-08-12
Author: akstrfn@gmail.com
File Name: scipy/sparse/dok.py
Class Name: dok_matrix
Method Name: __add__


Project Name: scipy/scipy
Commit Name: 5ce91f1cc0d3dcdb8b53c47990774173b82eff62
Time: 2017-08-12
Author: akstrfn@gmail.com
File Name: scipy/sparse/dok.py
Class Name: dok_matrix
Method Name: __radd__