68fe96add85bd842df23569dde490e1694d256fe,cleverhans/model_zoo/deep_k_nearest_neighbors/dknn.py,DkNNModel,find_train_knns,#DkNNModel#Any#,134

Before Change


          knns_ind[layer][i, :] = query_res
        except:  // pylint: disable-msg=W0702
          knns_ind[layer][i, :len(query_res)] = query_res
          knn_errors += knns_ind[layer].shape[1] - len(query_res)

      // Find labels of neighbors found in the training data.
      knns_labels[layer] = np.zeros((nb_data, self.neighbors), dtype=np.int32)
      for data_id in range(nb_data):

After Change


      d1 = neighbor_index.reshape(-1)
      m1 = d1 == -1

      knns_ind[layer].reshape(-1)[
        numpy.logical_not(m1)
      ] = d1[
        numpy.logical_not(m1)
      ]

      knn_erros = numpy.sum(m1)

      // Find labels of neighbors found in the training data.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorflow/cleverhans
Commit Name: 68fe96add85bd842df23569dde490e1694d256fe
Time: 2019-06-21
Author: siarheisiniak@yahoo.com
File Name: cleverhans/model_zoo/deep_k_nearest_neighbors/dknn.py
Class Name: DkNNModel
Method Name: find_train_knns


Project Name: biolab/orange3
Commit Name: ac892eddd865681c9746efeda9f1f094f26cc32f
Time: 2012-11-29
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/data/filter.py
Class Name: Filter_Random
Method Name: __call__


Project Name: dmlc/dgl
Commit Name: 562871e76b2d5adbcd907bcf62ca28c0611e50e1
Time: 2020-07-22
Author: zhengda1936@gmail.com
File Name: examples/pytorch/graphsage/experimental/train_dist.py
Class Name:
Method Name: main