df3e7eaf84e65be7e521c6de0379fb588de533ba,pynndescent/pynndescent_.py,,init_from_random,#Any#Any#Any#Any#Any#Any#Any#,43
Before Change
def init_from_random(n_neighbors, data, query_points, heap, dist, dist_args, rng_state):
for i in range(query_points.shape[0]):
if heap[0, i, 0] == -1:
for j in range(np.sum(heap[0, i] == -1)):
idx = np.abs(tau_rand_int(rng_state)) % data.shape[0]
d = dist(data[idx], query_points[i], *dist_args)
heap_push(heap, i, d, idx, 1)
return
@numba.njit(fastmath=True)
After Change
// idx = np.abs(tau_rand_int(rng_state)) % data.shape[0]
// d = dist(data[idx], query_points[i], *dist_args)
// heap_push(heap, i, d, idx, 1)
while heap[0, i, 0] == -1:
idx = np.abs(tau_rand_int(rng_state)) % data.shape[0]
d = dist(data[idx], query_points[i], *dist_args)
// potentially we can get away with this
unchecked_heap_push(heap, i, d, idx, 1)
return
@numba.njit(fastmath=True)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: lmcinnes/pynndescent
Commit Name: df3e7eaf84e65be7e521c6de0379fb588de533ba
Time: 2019-11-04
Author: leland.mcinnes@gmail.com
File Name: pynndescent/pynndescent_.py
Class Name:
Method Name: init_from_random
Project Name: nilmtk/nilmtk
Commit Name: b523b464d8cafe29e352981c1c6df941f205592a
Time: 2014-07-09
Author: jack-list@xlk.org.uk
File Name: nilmtk/metrics.py
Class Name:
Method Name: mean_normalized_error_power
Project Name: 7ossam81/EvoloPy
Commit Name: b050fe8d132a7d8899173e1c24d5906dbb943745
Time: 2019-02-26
Author: raneem.qaddoura@gmail.com
File Name: GA.py
Class Name:
Method Name: pairSelection