Class DNN_angular1_neighbors

java.lang.Object
io.nosqlbench.virtdata.lib.vectors.dnn.angular.DNN_angular1_neighbors
All Implemented Interfaces:
IntFunction<int[]>

public class DNN_angular1_neighbors extends Object implements IntFunction<int[]>
Compute the indices of the neighbors of a given v using DNN mapping. To avoid ambiguity on equidistant neighbors, odd neighborhood sizes are preferred.
  • Constructor Details

    • DNN_angular1_neighbors

      public DNN_angular1_neighbors(int k, int N, int modulus)
      Parameters:
      k - The size of neighborhood
      N - The number of total vectors, necessary for boundary conditions of defined vector
      modulus - The modulus used during training of angular1 data; this corresponds to how periodically we cycle back to vectors with the same angle (hence have angular distance zero between them)
  • Method Details

    • apply

      public int[] apply(int value)
      Specified by:
      apply in interface IntFunction<int[]>
      Parameters:
      value - the function argument, or the index of the query vector for the DNN addressing scheme
      Returns:
      A ranked neighborhood of vector indices, using the DNN addressing scheme