Search in sources :

Example 1 with MultipleProjectionsLocalitySensitiveHashFunction

use of de.lmu.ifi.dbs.elki.index.lsh.hashfunctions.MultipleProjectionsLocalitySensitiveHashFunction in project elki by elki-project.

the class AbstractProjectedHashFunctionFamily method generateHashFunctions.

@Override
public ArrayList<? extends LocalitySensitiveHashFunction<? super NumberVector>> generateHashFunctions(Relation<? extends NumberVector> relation, int l) {
    int dim = RelationUtil.dimensionality(relation);
    ArrayList<LocalitySensitiveHashFunction<? super NumberVector>> ps = new ArrayList<>(l);
    final Random rnd = random.getSingleThreadedRandom();
    for (int i = 0; i < l; i++) {
        RandomProjectionFamily.Projection mat = proj.generateProjection(dim, k);
        ps.add(new MultipleProjectionsLocalitySensitiveHashFunction(mat, width, rnd));
    }
    return ps;
}
Also used : Random(java.util.Random) NumberVector(de.lmu.ifi.dbs.elki.data.NumberVector) LocalitySensitiveHashFunction(de.lmu.ifi.dbs.elki.index.lsh.hashfunctions.LocalitySensitiveHashFunction) MultipleProjectionsLocalitySensitiveHashFunction(de.lmu.ifi.dbs.elki.index.lsh.hashfunctions.MultipleProjectionsLocalitySensitiveHashFunction) ArrayList(java.util.ArrayList) RandomProjectionFamily(de.lmu.ifi.dbs.elki.data.projection.random.RandomProjectionFamily) MultipleProjectionsLocalitySensitiveHashFunction(de.lmu.ifi.dbs.elki.index.lsh.hashfunctions.MultipleProjectionsLocalitySensitiveHashFunction)

Aggregations

NumberVector (de.lmu.ifi.dbs.elki.data.NumberVector)1 RandomProjectionFamily (de.lmu.ifi.dbs.elki.data.projection.random.RandomProjectionFamily)1 LocalitySensitiveHashFunction (de.lmu.ifi.dbs.elki.index.lsh.hashfunctions.LocalitySensitiveHashFunction)1 MultipleProjectionsLocalitySensitiveHashFunction (de.lmu.ifi.dbs.elki.index.lsh.hashfunctions.MultipleProjectionsLocalitySensitiveHashFunction)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1